diff options
author | Xerxes Rånby <[email protected]> | 2013-01-31 16:47:06 +0100 |
---|---|---|
committer | Xerxes Rånby <[email protected]> | 2013-01-31 16:47:06 +0100 |
commit | ae89ca7342b8673e38b7d76bff386175e84a9173 (patch) | |
tree | 9816b0d1a2ea5d364809df1bea635ce25634e4ec /src/newt | |
parent | f8bc0add2e3d18c397fb2af59e3787baa9dfc771 (diff) |
LinuxEventDeviceTracker: Map printable char using KeyEvent.isPrintableKey.
The NEWT VK namespace tries to map keyCodes
to its Unicode varianti, make use this quirk.
Signed-off-by: Xerxes Rånby <[email protected]>
Diffstat (limited to 'src/newt')
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java index 5c2a69142..5efce2524 100644 --- a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java +++ b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java @@ -258,7 +258,7 @@ public class LinuxEventDeviceTracker implements WindowListener { break; case 1: // EV_KEY keyCode = LinuxEVKey2NewtVKey(code); // The device independent code. - keyChar = LinuxEVKey2Unicode(code); // The printable character w/o key modifiers. + keyChar = NewtVKey2Unicode(keyCode); // The printable character w/o key modifiers. switch(value) { case 0: modifiers=0; @@ -314,6 +314,13 @@ public class LinuxEventDeviceTracker implements WindowListener { stop=true; } + private char NewtVKey2Unicode(int VK){ + if(KeyEvent.isPrintableKey(VK)){ + return (char)VK; + } + return 0; + } + private char LinuxEVKey2Unicode(short EVKey) { // This is the stuff normally mapped by a system keymap |