Quantcast
Viewing all articles
Browse latest Browse all 3768

How to set global keyboard shortcut?

Hi,
I have a menubar app, I would like to add a global keyboard shortcut, which works even when the menu is closed. I looked at the HotKeyMBS class but I can’t pass an alphabetic character (“w”) as a parameter with KeyCodeForText(“w”), or even with HotKeyMBS.KeyCode(keycode as integer). It works well with special characters (return, Fx, etc.) And then how do I display these shortcuts in my menu (nothing is displayed)? Is this the right approach?

App.Opening()
Var keyCodeReturn As Integer = HotKeyMBS.KeyCodeForText("w")
HotKeyReturn = new MyHotKey(keyCodeReturn, HotKeyMBS.CommandKey + HotKeyMBS.ControlKey) //CMD + CTRL + "W"

Thanks all,

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 3768

Trending Articles