[Win32] Keybindings with F1 send SWT.Help event
Description of the Bug
When a user presses any keybinding that includes the F1 key (e.g., Ctrl+F1), the SWT.Help event is sent alongside the intended keybinding. This is a probrem because if client wants to create keybinding with F1 then the SWT.Help event is sent alongside with the keybinding and this behaviour cannot be disabled
Desired Behavior
Keybindings with F1 should override SWT.Help in a manner similar to how keybindings override SWT.KeyDown event.
Cause of the Bug On Windows, pressing the F1 key without the Alt modifier generates two windows messages:
-
WM_KEYDOWNwithwParam == VK_F1 -
WM_KEYF1
Keybindings are handled by KeyBindingDispatcher filter listener which listens SWT.KeyDown event. SWT.KeyDown event is sent by dispatcher of WM_KEYDOWN. SWT.Help event is sent by dispatcher of WM_KEYDOWN which sent by DefWindowProc dispatching WM_KEYF1.
Possible Fixes
- Prevent
SWT.Helpfrom being sent onWM_HELP, or preventWM_HELPfrom being sent onWM_KEYF1. - Sends
SWT.HelponWM_KEYDOWNwithwparam == VK_F1if no keybindings are matched.
Can you propose a fix with a PR? However we might need to be sure that this "bug" is not used as "feature" by some consumers at least in the eclipse IDE.