| Summary: | Key event listener and active keys: clear active keys doesn't work | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | zzzz <nzanaga> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.0 | ||
| Target Milestone: | 3.2 M2 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| See Also: | https://git.eclipse.org/r/#/c/80292/ | ||
| Whiteboard: | |||
Fixed in master with change https://git.eclipse.org/r/#/c/80292/ |
I've a problem using "active keys" with key listener. I initially setup a set of keys on the control, and this works. But If I later clear the active keys, the result is wrong: the listener is disabled. I expect intead to receive all keys. Here the snippet: Shell shell = new Shell(display); Text t = new Text(shell, SWT.BORDER); t.setBounds(0, 0, 400, 400); t.setData("org.eclipse.rap.rwt.activeKeys", new String[] { "a", "b" }); t.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { System.out.println(e.character); if( e.character == 'a' ) { t.setData("org.eclipse.rap.rwt.activeKeys", null); } } }); shell.open(); In this snippet, when you press 'a', the listener will be disabled Note: if you set another key sequence, for example: new String[] { "x", "y" }, then It works as expected