Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用热键检测在C#中按破折号键_C#_Keyboard_Hotkeys - Fatal编程技术网

如何使用热键检测在C#中按破折号键

如何使用热键检测在C#中按破折号键,c#,keyboard,hotkeys,C#,Keyboard,Hotkeys,我想检测用户何时键入破折号,而不考虑其键盘布局。 我在用密码 非常感谢您的帮助。您的问题可能是您使用的是“减法”而不是“破折号”,我相信它们是两个独立的按键。尝试使用代码为189的键代替Keys.PrintScreen:ghk=newkeyHandler(Keys.PrintScreen,this);你的意思是做这个ghk=新的钥匙处理程序((钥匙)189,这个)? ghk = new KeyHandler(Keys.PrintScreen, this); // I want to detect

我想检测用户何时键入破折号,而不考虑其键盘布局。
我在用密码


非常感谢您的帮助。

您的问题可能是您使用的是“减法”而不是“破折号”,我相信它们是两个独立的按键。尝试使用代码为189的键代替Keys.PrintScreen:ghk=newkeyHandler(Keys.PrintScreen,this);你的意思是做这个ghk=新的钥匙处理程序((钥匙)189,这个)?
ghk = new KeyHandler(Keys.PrintScreen, this); // I want to detect the dash press event 
                                             // instead of the PrintScreen keypress  
ghk.Register();