Bug 340711 - [key binding] Key binding doesn't work correctly for Meta/Win key.
Summary: [key binding] Key binding doesn't work correctly for Meta/Win key.
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.1   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2011-03-22 18:23 EDT by Brian Davis CLA
Modified: 2020-07-12 12:25 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Davis CLA 2011-03-22 18:23:24 EDT
Build Identifier: 20100917-0705

Running Ubuntu 10.04 on an x86_64 platform.

I'm normally an Emacs user and have a keyboard with a separate Meta key (Happy Hacking keyboard, with layout very similar to the old Sun keyboard).  Attempting to map the "Word Completion" command to "Meta+/" (AKA "Alt+/") does not work in the Preferences dialog.  When I select the "Word Completion" row of the binding table and then click in the "Binding:" text box, it displays the string "Alt+" while I hold down the Meta key, but erases that string and replaces it with '/' when I press the '/' key.

I have the keyboard and OS configured to generate the Win key keycode for the Meta key, so this should probably be reproducible on keyboards that don't have an explicit Meta key.


Reproducible: Always

Steps to Reproduce:
1. Set Ubuntu key mapping behavior to map the Meta key to the Win key scan code (System->Preferences->Keyboard to bring up the "Keyboard Preferences" dialog, select the Layouts tab, press the "Options..." button, select the "Meta is mapped to Win keys" radio button under the "Alt/Win key behavior" drop-down.

2. Open the Preferences dialog in Eclipse Editor (Window->Preferences).

3. Expand the "General" item on the left side tree control.

4. Select the "Keys" item.

5. Scroll the binding table down until the row for the "Word Completion" command is visible (it's near the bottom) and select it.

6. Click in the "Binding:" text box to change the binding.

7. Hold down the Meta/Win key, the text box should display "Alt+" after this is done (indicating that the program is somehow reading the key press event as an Alt key press).

8. Press the '/' key, the text box should change from "Alt+" to '/'.
Comment 1 Prakash Rangaraj CLA 2011-03-23 01:36:20 EDT
Sounds like an SWT bug. Moving to SWT.
Comment 2 Felipe Heidrich CLA 2011-03-24 10:45:22 EDT
I don't think SWT has a constant for the meta key,
Please run org.eclipse.swt.snippets.Snippet25.java and press the win key, does it print anything to the console ?
Comment 3 Brian Davis CLA 2011-03-24 13:12:24 EDT
I downloaded org.eclipse.swt.snippets from the Eclipse CVS repository at dev.eclipse.org and ran Snippet25.  Here is what it prints on the console:

DOWN: stateMask=0x0, keyCode=0x10000 ALT, character=0x0 '\0'
UP  : stateMask=0x0, keyCode=0x10000 ALT, character=0x0 '\0'
Comment 4 Dani Megert CLA 2012-09-18 03:20:03 EDT
*** Bug 389664 has been marked as a duplicate of this bug. ***
Comment 5 Eclipse Genie CLA 2020-07-12 12:25:03 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.