Community
Participate
Working Groups
This should be way down the list, but following Mac HIG, the space bar should toggle checkboxes on and off when they have focus. I think radio buttons should cycle as well, but not sure on that one. Even some Apple apps break this now, but it is a really nice feature for a keyboard enabled app like Eclipse.
This works in ControlExample and in this simple test case: public static void main(String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); Button button = new Button(shell, SWT.CHECK); button.setText("check"); button.pack(); shell.setBounds(0, 0, 200, 75); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
Go to Keyboard & Mouse preference panel. Click "Keyboard Shortcuts" and then set "Full keyboard access" to "All controls". That will do the right thing for buttons and popup menus (bug 252236). That's the standard cocoa thing to do -- if you want this behavior all the time we need to special case for it in Button.
The behaviour caused by this setting should be preserved for the user. I see that Space does toggle the checkbox if "All controls" is selected, and doesn't otherwise. So this is working as expected. I'm not sure what you mean by radio buttons cycling. The current behaviour is that Tab tabs into a radio group, and then radios within the group can be selected with the arrows. This seems to match the behaviour I see in the System Preferences (once the "All controls" option is selected). Should it be doing something different?
Hmm.. Does work for me under carbon but not on Cocoa. *However* I did just have to switch back to an earlier build (M4) so if more recent changes fixed it.. I'll check again when I get a newer build.
And yeah, Grant I think you're right about radio button behavior w/ arrows. Makes UI sense, I checked a couple of other apps and they all conform, and its more consistent w/ combo boxes. Way OT, but since we're all Mac geeks, can someone else please confirm wether I'm correct about bug 232420? This drives me absolutely bonkers.
code in comment #1 works for me. Can we close this?
Yep, works for me now. Thanks.
fixed