简体   繁体   English

使用RegisterHotKey使用Numpad注册热键

[英]Using RegisterHotKey to register hot key using Numpad

I have used RegisterHotKey for registering a global hotkey for my application. 我已经使用RegisterHotKey为我的应用程序注册了全局热键。 I need to register Control + Shift + 0 (in numpad) for the application. 我需要为应用程序注册Control + Shift + 0(在数字键盘上)。 I have registered it using the below code snippet: 我已经使用以下代码段进行了注册:

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

However it not responding as expected, other hotkeys are getting registered, only the above combination is not responding. 但是,它没有按预期方式响应,正在注册其他热键,仅上述组合没有响应。

Shift + Numpad generated a different code, hence Ctrl+Shft+Numpad was not producing expected result. Shift + Numpad生成了不同的代码,因此Ctrl + Shft + Numpad无法产生预期的结果。 I found a workaround by changing the shortcut from Ctrl+Shift+Numpad to Ctrl+Numpad. 通过将快捷方式从Ctrl + Shift +数字键更改为Ctrl +数字键,我找到了一种解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM