| Summary: | SWT: Numberkeystrokes support only Keypad | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Nathan Burgherr <nathan.burgherr> | ||||||
| Component: | Scout | Assignee: | Project Inbox <scout.core-inbox> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | Andreas.Hoegger, wayne.beaton, zimmermann | ||||||
| Version: | unspecified | Flags: | zimmermann:
indigo+
zimmermann: juno+ |
||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows Vista | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 199738 [details]
Patch for projects ui.swt and testing.client
Created attachment 199740 [details]
Patch for projects ui.swt and testing.client
Patch applied for Indigo SP1 and trunk. Thank you Claudio. The patch, if applied to the code base, must be flagged iplog+ so that it appears in the log. shipped with scout 3.7.1 removed iplog flag from ticket and added iplog flag to attachment |
Build Identifier: If you register a keystroke with a number, it listens only to the numbers on the keypad but not to those over the alphabetical keys. Solution hint: In the SwtUtility class in getKeyStrokes there is a special Case for the CR. It registers the normal CR and the one on the keypad. The same is needed for the numbers. public static ISwtKeyStroke[] getKeyStrokes(IKeyStroke stroke, ISwtEnvironment environment) { ArrayList<ISwtKeyStroke> swtKeyStrokes = new ArrayList<ISwtKeyStroke>(); int keycode = getSwtKeyCode(stroke); int stateMask = getSwtStateMask(stroke); // in case of enter register keypad enter as well if (keycode == SWT.CR) { swtKeyStrokes.add(new SwtScoutKeyStroke(stroke, SWT.CR, stateMask, environment)); swtKeyStrokes.add(new SwtScoutKeyStroke(stroke, SWT.KEYPAD_CR, stateMask, environment)); } else { swtKeyStrokes.add(new SwtScoutKeyStroke(stroke, keycode, stateMask, environment)); } return swtKeyStrokes.toArray(new ISwtKeyStroke[swtKeyStrokes.size()]); } Reproducible: Always Steps to Reproduce: 1. Register a number key as keystroke somewhere in the application @Order(50.0) public class FiveKeyStroke extends AbstractKeyStroke { @Override protected String getConfiguredKeyStroke() { return "5"; } @Override protected void execAction() throws ProcessingException { System.out.println("5 pressed"); } } 2. Start application an try to get into execAction throug hitting 5 over the alphapetical keys