eRCP/eSWT: Windows CE and Win32 (XP): Different Keyboard Event Handling
When developing GUIs with Swing in Java I often swear about event handling, because it sometimes slightly differs from what the underlying platform would do. However when using SWT/eSWT and getting the native behaviors there are also gotchas waiting... In our Eclipse Embedded Rich Client Platform ( eRCP ) based mobile application we want to allow keyboard as well as touch-screen access. In order to do so we attach a KeyListener to the buttons that handle the assigned shortcut bindings in addition to a SelectionListener to respond to clicks. Another feature request called for the possibility to trigger a button by moving the focus to it with the keyboard and then hitting enter. During development we usually work with the eSWT implementation for Win32. Because by default pressing enter does not do anything on a button, we add another KeyListener to respond to the return key. This usually works flawlessly. However on the mobile device we had trouble with button actions being trigger