开发者

How to simulate key presses in C# [closed]

开发者 https://www.devze.com 2023-02-03 17:05 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago. 开发者_JS百科

How would you go about sending key commands or keypresses of particular keys in C#, specifically numbers.

For instance I would like to simulate typing "512" programatically.

Possibly Related: C# SendKeys.Send


If you would use inputsimulator you could just do:

   var number = 2011;
   InputSimulator.SimulateTextEntry(number.ToString());


An integer variable doesn't have a UI, so can't have a keypress.


Events are for visual objects, not for variables

0

精彩评论

暂无评论...
验证码 换一张
取 消