简体   繁体   English

C#-我想从数字键盘上的两个键(从后台)获取用户输入,并使这些输入增加或减少一个int计数器

[英]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.

相关问题 有没有办法在 c# Windows 桌面应用程序中按住左 ALT 键的同时发送 Numpad3 + Numpad4 键以获得双引号? - Is there a way to Send Numpad3 + Numpad4 keys while holding Left ALT in c# Windows Desktop Applicationto get double quotes? C#从int获取位为int - c# get bits from int as int 如何使用户输入int空值C# - how to make user input int null value c# 统一获得两个键的输入 - Get input from two keys in unity 如何从用户获取输入直到他想要停止使用可能是使用c#中的文件流的分隔符或其他方式? - How to get input from user until he want to stop using may be delimeter or anothor way using filestream in c#? 当用户输入是一个字符串并且它应该是一个带有 int.tryparse 的整数时,如何阻止 c# 崩溃? - How do I stop c# from crashing when user input is a string and its supposed to be an integer with int.tryparse? 在C#中如何从字典中获取键列表? - In C# how do I get a list of the keys from a dictionary? C#:根据用户输入创建字符串数组,然后,如果无法将其解析为int数组,请重试输入 - C#: Creating a string array from user input, then if it can't be parsed into int array, retrying the input 为用户输入C#创建计数器 - Creating a Counter for user input C# 我正在尝试在 while 循环中获取一个 int 列表以将用户输入存储在 c# 中 - I'm trying to get a int list in a while loop to store user input in c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM