Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 20672 - Shift+F10 has wrong keyCode
Summary: Shift+F10 has wrong keyCode
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: PC HP-UX
: P3 normal (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-19 13:16 EDT by Grant Gayed CLA
Modified: 2002-09-27 14:34 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2002-06-19 13:16:51 EDT
F3

A snippet is included below that simply listens for key presses and prints the 
respective keyCode and state for each.  When it's run on any platform other 
than hpux its values for Shift+F10 are:

Key Pressed: 16777235.  State: 131072

However on hpux pressing Shift+F10 gives:

Key Pressed: 0.  State: 131072

This causes an accessibility problem in Eclipse because Shift+F10 is used to 
display the context menu for the currently selected item.

It might be another problem case in Widget.setKeyState().
Comment 1 Sridhar Bidigalu CLA 2002-06-19 17:24:05 EDT
Can I get the code snippet, Thanks!
Comment 2 Grant Gayed CLA 2002-06-19 17:34:39 EDT
Sorry, I forgot...

import org.eclipse.swt.events.*;
import org.eclipse.swt.widgets.*;

public class KeysShow {

	public static void main(String[] args) {
		Shell shell = new Shell();
		shell.addKeyListener(new KeyAdapter() {
			public void keyPressed(KeyEvent e) {
				System.out.print("Key Pressed: " + e.keyCode);
				System.out.println(".  State: " + e.stateMask);
			}
		});

		shell.open();
		Display display = Display.getDefault();
		while (!shell.isDisposed())
			if (!display.readAndDispatch())
				display.sleep();
		shell.dispose();
	}
}
Comment 3 Veronika Irvine CLA 2002-09-10 11:27:45 EDT
Please investigate status of this report.
Comment 4 Grant Gayed CLA 2002-09-11 10:29:22 EDT
post-2.0 bug cleanup note: still happens.  The problem is that XLookupString is 
answering a strange keysym for Shift+F10 (and also Shift+F9, Shift+F11, 
Shift+12).  We may need to add special cases to Widget.setKeyState(), but 
should first see if this is documented anywhere.
Comment 5 Grant Gayed CLA 2002-09-27 14:23:31 EDT
Fixed, used same approach as on Solaris to fix F11 and F12 mappings
Comment 6 Grant Gayed CLA 2002-09-27 14:34:40 EDT
Note that the keysyms originally answered by XLookupString correspond to 
Keypad+F1-Keypad+F4.