|Help with MenuItem.setAccelerator() on OS X [message #531391]
||Tue, 04 May 2010 13:23
| Doug M
Registered: December 2009
I would like to specify that cmd-minus is the key for a "zoom out" menu item. Using|
item.setAccelerator(SWT.MOD1 | '-')
shows the correct command glyphs in the menu item. However, it responds to both cmd-minus and cmd-shift-minus (that's cmd-underline).
I want it to respond only to cmd-minus.
If I try different base keys, the shifted and non-shifted versions are correctly distinguished. For example,
item.setAccelerator(SWT.MOD1 | 'd');
responds only to cmd-d, and
item.setAccelerator(SWT.SHIFT | SWT.MOD1 | 'd');
responds only to cmd-shift-d, both showing correct glyphs in the menu item.
I tried SWT.KEYCODE_BIT with the actual keycode, but that also fails to distinguish minus and underline.
Can anyone explain, or suggest a solution?
Powered by FUDForum
. Page generated in 0.02681 seconds