| Summary: | KeyEvent management differs depending browser(retun key keyEvent not sent on ie, safari and chrome) | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | bertram <bveli75> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | tbuschto |
| Version: | 1.4 | ||
| Target Milestone: | 1.5 M5 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
| Bug Depends on: | 367871 | ||
| Bug Blocks: | |||
|
Description
bertram
If i what right, what you could use it shell.setDefaultButton. It sets the button that gets selected when Enter is pressed. I'm looking into why the Enter button isn't sent anyway. Even setting the defaultButton on the shell does not work : (focus is present on the chexk button) Sorry for the butchered comment#1. I think whats happening is that some widgets call preventDefault internally on certain keydown events (in this case button on Space and Enter), which prevents the keypress event the KeyEventUtil listens to from beeing fired. I would have to check in SWT to be certain, but i think the issue here is that KeyEventUtil only listens for keypress, when it should listen for both (keypress and keydown). I will investigate that possibility. Turns out preventing default for keydown does not supress the follow-up keypress events, so the problem is another. I revoke my precious comment, preventDefault is the problem. One workaround is to add the button you want to listen to the widgets cancel keys (see RWT.CANCEL_KEYS). But this will also prevent the check button from beeing selected/unselected by the enter key. Partially fixed in CVS HEAD. Fixed for Combo, Button, ToolItem by removing some unnecessary preventDefault calls. For Text this is slightly more complicated, Backspace and Enter might both be necessary to cancel. Fixed together with Bug 367876. Keydown events are now also used to send key events to server. |