开发者

What key combinations should be used by Windows application to avoid conflicts?

I have an application that runs in the background o开发者_如何学编程n a Windows OS, and I want to add HotKeys or shortcuts to access functionality. Since the application will capture system wide key presses, I don't want to interfere with standard Windows shortcuts or standard application specific shortcuts (e.g. Ctrl+S, Alt+F4).

Is there a group of key combinations set aside for application specific use, or is it just a matter of finding unused combinations and using them? Are there any standards when it comes to this type of thing?


I don't know of a convention for adding your own that would avoid those created by others. From MSDN:

RegisterHotKey fails if the keystrokes specified for the hot key have already been registered by another hot key.

So you could have a list of hot keys. Try to register each one until you succeed. Even better: let the user choose.


One idea might be to pick a standard start to flag your application. Perhaps all your application's key combinations could start with Ctrl-Keypad 0 followed by a command letter. Ctrl-Keypad 0 is unusual enough that other applications are unlikely to use it, and after that combination you can use common keys: Ctrl-Keypad 0C for Copy and Ctrl-Keypad 0V for paste etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜