diff options
author | Xerxes Rånby <[email protected]> | 2013-04-08 22:03:53 +0200 |
---|---|---|
committer | Xerxes Rånby <[email protected]> | 2013-04-09 12:04:47 +0200 |
commit | 578011822abb973800f96a21138c497862cba800 (patch) | |
tree | 295a3d78babe56503031b45433202890ef01738a /src/newt | |
parent | dc049d5ab60c856576ee7dd58d3cc36da9f9780b (diff) |
LinuxEventDeviceTracker: ALT, ALT_GRAPH & CTRL modifiers.
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 | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java index 8651c2551..7b8c5eb2a 100644 --- a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java +++ b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java @@ -271,9 +271,19 @@ public class LinuxEventDeviceTracker implements WindowListener { case 0: eventType=KeyEvent.EVENT_KEY_RELEASED; - if(keyCode == KeyEvent.VK_SHIFT){ - System.out.println("release-shift"); + switch(keyCode) { + case KeyEvent.VK_SHIFT: modifiers &= ~InputEvent.SHIFT_MASK; + break; + case KeyEvent.VK_ALT: + modifiers &= ~InputEvent.ALT_MASK; + break; + case KeyEvent.VK_ALT_GRAPH: + modifiers &= ~InputEvent.ALT_GRAPH_MASK; + break; + case KeyEvent.VK_CONTROL: + modifiers &= ~InputEvent.CTRL_MASK; + break; } if(null != focusedWindow) { @@ -286,8 +296,19 @@ public class LinuxEventDeviceTracker implements WindowListener { case 1: eventType=KeyEvent.EVENT_KEY_PRESSED; - if(keyCode == KeyEvent.VK_SHIFT){ + switch(keyCode) { + case KeyEvent.VK_SHIFT: modifiers |= InputEvent.SHIFT_MASK; + break; + case KeyEvent.VK_ALT: + modifiers |= InputEvent.ALT_MASK; + break; + case KeyEvent.VK_ALT_GRAPH: + modifiers |= InputEvent.ALT_GRAPH_MASK; + break; + case KeyEvent.VK_CONTROL: + modifiers |= InputEvent.CTRL_MASK; + break; } if(null != focusedWindow) { @@ -300,8 +321,20 @@ public class LinuxEventDeviceTracker implements WindowListener { case 2: eventType=KeyEvent.EVENT_KEY_PRESSED; modifiers |= InputEvent.AUTOREPEAT_MASK; - if(keyCode == KeyEvent.VK_SHIFT){ + + switch(keyCode) { + case KeyEvent.VK_SHIFT: modifiers |= InputEvent.SHIFT_MASK; + break; + case KeyEvent.VK_ALT: + modifiers |= InputEvent.ALT_MASK; + break; + case KeyEvent.VK_ALT_GRAPH: + modifiers |= InputEvent.ALT_GRAPH_MASK; + break; + case KeyEvent.VK_CONTROL: + modifiers |= InputEvent.CTRL_MASK; + break; } if(null != focusedWindow) { |