Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.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# 使用RegisterHotKey使用Numpad注册热键_C#_User32_Registerhotkey_Global Hotkey_Numpad - Fatal编程技术网

C# 使用RegisterHotKey使用Numpad注册热键

C# 使用RegisterHotKey使用Numpad注册热键,c#,user32,registerhotkey,global-hotkey,numpad,C#,User32,Registerhotkey,Global Hotkey,Numpad,我已使用RegisterHotKey为我的应用程序注册全局热键。 我需要为应用程序注册Control+Shift+0(单位为numpad)。 我已使用以下代码段注册了它: RegisterHotKey(_mainWindowHandle, 1, (uint)ModifierKeys.Control | (uint)ModifierKeys.Shift | 0X4000, (uint)Keys.NumPad0); 但是它没有按预期响应,其他热键正在注册,只有上面的组合没有响应。Shift+Num

我已使用
RegisterHotKey
为我的应用程序注册全局热键。 我需要为应用程序注册Control+Shift+0(单位为numpad)。 我已使用以下代码段注册了它:

RegisterHotKey(_mainWindowHandle, 1, (uint)ModifierKeys.Control | (uint)ModifierKeys.Shift | 0X4000, (uint)Keys.NumPad0);

但是它没有按预期响应,其他热键正在注册,只有上面的组合没有响应。

Shift+Numpad生成了不同的代码,因此Ctrl+Shft+Numpad没有生成预期的结果。我找到了一个解决方法,将快捷键从Ctrl+Shift+Numpad更改为Ctrl+Numpad。

当然,当按住Shift键时,Numpad键会生成不同的代码。NumPad0变为Insert。NumLock键的状态也很重要,所以对于热键来说可能不是一个很好的选择。