diff options
author | Sven Gothel <[email protected]> | 2014-01-04 17:20:00 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-01-04 17:20:00 +0100 |
commit | 2d3a311b7863ed598865f19833417abb6e27a513 (patch) | |
tree | a1d37db2ae884b69632f756f8ae2c8533ee3d926 | |
parent | bec29cf970e6a55eb8f720afdae5a3bdc97c1ba2 (diff) |
JOGLNewtAppletBase Default Key-Action: Add 'j' for setPointerConfined() .. i.e. 'jailed'
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java index eac328cdd..7ffbc2e83 100644 --- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java +++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java @@ -364,6 +364,15 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener { glWindow.setPointerVisible(!glWindow.isPointerVisible()); System.err.println("[set mouse visible post]: "+glWindow.isPointerVisible()); } }.start(); + } else if(e.getKeyChar()=='j') { + new Thread() { + public void run() { + final Thread t = glWindow.setExclusiveContextThread(null); + System.err.println("[set mouse confined pre]: "+glWindow.isPointerConfined()); + glWindow.confinePointer(!glWindow.isPointerConfined()); + System.err.println("[set mouse confined post]: "+glWindow.isPointerConfined()); + glWindow.setExclusiveContextThread(t); + } }.start(); } else if(e.getKeyChar()=='w') { new Thread() { public void run() { |