Community
Participate
Working Groups
I'm setting the CTRL + / and CTRL + SHIFT + / as menu accelerators. They don't work. To reproduce run the test case below and press CTRL + /. You should see output in the console. Press CTRL + R and you will see output as expected. import com.ibm.swt.*; import com.ibm.swt.widgets.*; public class PR_1FYAF8V { public static void main(String[] args) { Shell shell = new Shell(); Menu menuBar = new Menu(shell, SWT.BAR); MenuItem item0 = new MenuItem(menuBar, SWT.CASCADE); Menu menu = new Menu(menuBar); MenuItem item1 = new MenuItem(menu, SWT.PUSH); MenuItem item2 = new MenuItem(menu, SWT.PUSH); MenuItem item3 = new MenuItem(menu, SWT.PUSH); item0.setText("item0"); item0.setMenu(menu); shell.setMenuBar(menuBar); item1.setText("item1 CTRL + /"); item1.setAccelerator(SWT.CTRL | '/'); item2.setText("item2 CTRL + SHIFT + /"); item2.setAccelerator(SWT.CTRL | SWT.SHIFT | '/'); item3.setText("item3 CTRL + R"); item3.setAccelerator(SWT.CTRL | 'R'); Listener listener = new Listener() { public void handleEvent(Event e) { System.out.println(e.widget); } }; item1.addListener(SWT.Selection, listener); item2.addListener(SWT.Selection, listener); item3.addListener(SWT.Selection, listener); shell.open(); Display display = shell.getDisplay (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } } } NOTES: VI (10/4/00 11:31:58 AM) There is code in Display that is commented out that maps the KeyPad keys for the accelerator table. If I uncomment the SWT.KP_DIVIDE entry, I can cause the CTRL + SHIFT + '/' case to work but only when I use the '/' key in the numeric keypad. SN (2/5/01 2:40:41 PM) Spent some time looking into this. Need to write a DLL only example.
PRODUCT VERSION: SWT 0.44
Fixed in R2.0.