Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316329 - Need SWT to provide an API to allow F10 to be overridden
Summary: Need SWT to provide an API to allow F10 to be overridden
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-09 11:33 EDT by Raji Akella CLA
Modified: 2010-09-15 16:57 EDT (History)
7 users (show)

See Also:


Attachments
patch for Linux (1.80 KB, patch)
2010-09-03 09:29 EDT, Felipe Heidrich CLA
no flags Details | Diff
patch for gtk (1.84 KB, patch)
2010-09-03 16:06 EDT, Felipe Heidrich CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raji Akella CLA 2010-06-09 11:33:31 EDT
Build Identifier: 3.7

Please see bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=309286

Reproducible: Always
Comment 1 Silenio Quarti CLA 2010-08-06 17:24:35 EDT
Please see

https://bugs.eclipse.org/bugs/show_bug.cgi?id=309286#c8

We believe there is no bug here. I am to bind F10 to content assist in 3.6 for example.
Comment 2 Silenio Quarti CLA 2010-08-10 14:27:39 EDT
Closing bug as INVALID.
Comment 3 Paul Webster CLA 2010-08-11 13:43:14 EDT
With items under the File menu, I no longer get *any* key events.

PW
Comment 4 Paul Webster CLA 2010-08-11 13:44:05 EDT
I added the following to the snippet:

Menu file = new Menu(item);
item.setMenu(file);
new MenuItem(file, SWT.PUSH).setText("One");
new MenuItem(file, SWT.PUSH).setText("Two");
new MenuItem(file, SWT.PUSH).setText("Three");

My tests run on linux.

PW
Comment 5 Felipe Heidrich CLA 2010-08-12 11:14:57 EDT
Okay, I have some code in Linux that allows us to process the event before the OS.

But in the Mac I'm afraid the same can't be done. The OS has a default keybinding for F10. The only way (AFAIK) for an application to see a key down is:
System-Preferences->Keyboard->Keyboard shortcuts->Expose & Spaces
Reassign the keybinding of "Application windows" from F10 to something else.

You can do the same on Linux, not sure if there is a nice UI to do so, but you can reassign the shortcut for the menubar using the command line:

gconftool-2 --type string --set  '/desktop/gnome/interface/menubar_accel' 'F11'

(Instead of 'F11' you can pass use an empty string to remove the shortcut)

After doing this, the application will start to receive F10 key down events.
Comment 6 Felipe Heidrich CLA 2010-09-03 09:29:05 EDT
Created attachment 178142 [details]
patch for Linux

note: i have already released all the required native methods
Comment 7 Felipe Heidrich CLA 2010-09-03 16:06:52 EDT
Created attachment 178199 [details]
patch for gtk
Comment 8 Felipe Heidrich CLA 2010-09-03 16:08:33 EDT
Patch for GTK released.

Nothing to do for Cocoa (user has to change the property in the System preferences, otherwise the system consumes the key before it gets to SWT).

Works on windows.

closing as fixed.