Am 11.09.2012 um 14:46 schrieb Gavin Smith <[email protected]>:

> I am trying to implement keyboard shortcuts on NSStatusItems but I can't 
> figure out how. The StatusItem example app has .keyequivalent set and you can 
> see the shortcut in the menu but I'm not sure if this has been implemented - 
> maybe it's just for an example?
> 
> I would appreciate any help in getting keyboard shortcuts working with 
> NSStatusItems.


You can try like this:


 a.keyEquivalent = encodings.UTF8.Chr(NSEventMBS.NSF6FunctionKey)
 a.keyEquivalentModifierMask = NSEventMBS.NSCommandKeyMask

this works for me and shows command F6 in the menu and menu item action is 
executed when the app is frontmost.

For background, you'd need something like CarbonHotKeyMBS class.

Greetings
Christian

-- 
Read our blog about news on our plugins:

http://www.mbsplugins.de/

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to