[英]C# - I want to get user input (from the background) from two keys on the numpad and make those inputs raise or lower an int counter
Basically, I'm using a Wacom tablet with PhotoShop at work. 基本上,我正在使用带有PhotoShop的Wacom平板电脑。 One thing I want to be able to do is cycle through the opacity stages with the keys 1-0.
我想做的一件事是用1-0键在不透明阶段中循环。
The touch ring on the Wacom only accepts two inputs, obviously not enough for me to use. Wacom上的触摸环仅接受两个输入,显然不足以供我使用。
I want to be able to (From the background, I want no user interface for this), create a simple counter, that goes up and down in ones. 我希望能够(从后台开始,我不需要此操作的用户界面),创建一个简单的计数器,该计数器可以上下移动。 I want the "8" key on the numpad to raise this number, and the "2" key on the numpad to lower this number.
我希望数字键盘上的“ 8”键提高该数字,而数字键盘上的“ 2”键降低该数字。
After the key has been pressed, and the counter has been modified to its new value, I want to have the value be simulated as a key press. 按下键并将计数器修改为新值后,我希望将该值模拟为按键。
I started learning C# a long time ago, and have left it alone for an even longer time, I would like to use this project as a way to get back into using C#, to make little useful programs for myself for every day use. 我很早以前就开始学习C#,并且将其搁置了甚至更长的时间,我想将此项目用作重新使用C#的一种方式,为自己的日常使用编写一些有用的程序。
Thanks in advance guys, I can't wait to see how this would actually be coded! 在此先感谢大家,我迫不及待地想看看它的实际编码方式!
Please use Form.KeyPreview
. 请使用
Form.KeyPreview
。 You can find an example at https://msdn.microsoft.com/en-us/library/system.windows.forms.form.keypreview.aspx . 您可以在https://msdn.microsoft.com/zh-cn/library/system.windows.forms.form.keypreview.aspx中找到示例。 Hope you can figure out the rest.
希望您能找出其余的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.