diff options
author | Sven Gothel <[email protected]> | 2013-05-16 21:33:25 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-05-16 21:33:25 +0200 |
commit | 86a5460c5052cdab7b9f6294c46a0b4e30dfa260 (patch) | |
tree | 5c029a5d847fe6f7856098e5c734dd621cd31c9d /src/newt/classes/jogamp | |
parent | 890dabf77593732bd9833350b441a37c60f74d45 (diff) |
Fix Bug 723: Remove VK_KP_<Cursor> numpad key-codes, use general VK_<Cursor> key-codes; Respect numpad printable keys; Use keySym for numpad if possible.
- KeyEvent keyCode/keySym values re-ordered!
- Remove VK_KP_<Cursor> numpad key-codes, use general VK_<Cursor> key-codes.
Numpad cursor keys are not supported on some platforms (Windows),
or not configured on most X11 configurations.
- Respect numpad printable keys,
i.e. don't treat them as non-printable.
- Use keySym for numpad if possible.
Numpad keys require modifiers, hence X11 and Windows shall return keySym.
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java | 12 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java | 4 |
2 files changed, 4 insertions, 12 deletions
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java index ccbdc07bf..a1aa69e0a 100644 --- a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java +++ b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java @@ -369,13 +369,13 @@ public class AWTNewtEventFactory { case java.awt.event.KeyEvent.VK_MULTIPLY : return com.jogamp.newt.event.KeyEvent.VK_MULTIPLY; case java.awt.event.KeyEvent.VK_DIVIDE : return com.jogamp.newt.event.KeyEvent.VK_DIVIDE; case java.awt.event.KeyEvent.VK_NUM_LOCK : return com.jogamp.newt.event.KeyEvent.VK_NUM_LOCK; - case java.awt.event.KeyEvent.VK_KP_LEFT : return com.jogamp.newt.event.KeyEvent.VK_KP_LEFT; - case java.awt.event.KeyEvent.VK_KP_UP : return com.jogamp.newt.event.KeyEvent.VK_KP_UP; - case java.awt.event.KeyEvent.VK_KP_RIGHT : return com.jogamp.newt.event.KeyEvent.VK_KP_RIGHT; - case java.awt.event.KeyEvent.VK_KP_DOWN : return com.jogamp.newt.event.KeyEvent.VK_KP_DOWN; + case java.awt.event.KeyEvent.VK_KP_LEFT : /** Fall through intended .. */ case java.awt.event.KeyEvent.VK_LEFT : return com.jogamp.newt.event.KeyEvent.VK_LEFT; + case java.awt.event.KeyEvent.VK_KP_UP : /** Fall through intended .. */ case java.awt.event.KeyEvent.VK_UP : return com.jogamp.newt.event.KeyEvent.VK_UP; + case java.awt.event.KeyEvent.VK_KP_RIGHT : /** Fall through intended .. */ case java.awt.event.KeyEvent.VK_RIGHT : return com.jogamp.newt.event.KeyEvent.VK_RIGHT; + case java.awt.event.KeyEvent.VK_KP_DOWN : /** Fall through intended .. */ case java.awt.event.KeyEvent.VK_DOWN : return com.jogamp.newt.event.KeyEvent.VK_DOWN; case java.awt.event.KeyEvent.VK_CONTEXT_MENU : return com.jogamp.newt.event.KeyEvent.VK_CONTEXT_MENU; case java.awt.event.KeyEvent.VK_WINDOWS : return com.jogamp.newt.event.KeyEvent.VK_WINDOWS; @@ -550,10 +550,6 @@ public class AWTNewtEventFactory { case com.jogamp.newt.event.KeyEvent.VK_MULTIPLY : return java.awt.event.KeyEvent.VK_MULTIPLY; case com.jogamp.newt.event.KeyEvent.VK_DIVIDE : return java.awt.event.KeyEvent.VK_DIVIDE; case com.jogamp.newt.event.KeyEvent.VK_NUM_LOCK : return java.awt.event.KeyEvent.VK_NUM_LOCK; - case com.jogamp.newt.event.KeyEvent.VK_KP_LEFT : return java.awt.event.KeyEvent.VK_KP_LEFT; - case com.jogamp.newt.event.KeyEvent.VK_KP_UP : return java.awt.event.KeyEvent.VK_KP_UP; - case com.jogamp.newt.event.KeyEvent.VK_KP_RIGHT : return java.awt.event.KeyEvent.VK_KP_RIGHT; - case com.jogamp.newt.event.KeyEvent.VK_KP_DOWN : return java.awt.event.KeyEvent.VK_KP_DOWN; case com.jogamp.newt.event.KeyEvent.VK_LEFT : return java.awt.event.KeyEvent.VK_LEFT; case com.jogamp.newt.event.KeyEvent.VK_UP : return java.awt.event.KeyEvent.VK_UP; case com.jogamp.newt.event.KeyEvent.VK_RIGHT : return java.awt.event.KeyEvent.VK_RIGHT; diff --git a/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java index 5e240636d..24a5c41de 100644 --- a/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java +++ b/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java @@ -189,13 +189,9 @@ public class SWTNewtEventFactory { case com.jogamp.newt.event.KeyEvent.VK_MULTIPLY : return SWT.KEYPAD_MULTIPLY; case com.jogamp.newt.event.KeyEvent.VK_DIVIDE : return SWT.KEYPAD_DIVIDE; case com.jogamp.newt.event.KeyEvent.VK_NUM_LOCK : return SWT.NUM_LOCK; - case com.jogamp.newt.event.KeyEvent.VK_KP_LEFT : case com.jogamp.newt.event.KeyEvent.VK_LEFT : return SWT.ARROW_LEFT; - case com.jogamp.newt.event.KeyEvent.VK_KP_UP : case com.jogamp.newt.event.KeyEvent.VK_UP : return SWT.ARROW_UP; - case com.jogamp.newt.event.KeyEvent.VK_KP_RIGHT : case com.jogamp.newt.event.KeyEvent.VK_RIGHT : return SWT.ARROW_RIGHT; - case com.jogamp.newt.event.KeyEvent.VK_KP_DOWN : case com.jogamp.newt.event.KeyEvent.VK_DOWN : return SWT.ARROW_DOWN; case com.jogamp.newt.event.KeyEvent.VK_HELP : return SWT.HELP; } |