diff options
author | Sven Gothel <[email protected]> | 2009-06-16 07:40:21 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-06-16 07:40:21 +0000 |
commit | ac2cdb722753f4eb5294cac532d54b284ad21725 (patch) | |
tree | 2a36e7c8025f103bc3286452b5a33a6217f9f2a0 | |
parent | 41cd6c47b23975098cd155517790e018670785e7 (diff) |
quit: 'q' + button-1 double click; fullscreen: 'f' + button-2 click
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@353 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
-rwxr-xr-x | src/demos/es1/RedSquare.java | 8 | ||||
-rwxr-xr-x | src/demos/es2/RedSquare.java | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java index 3992fc7..5c8e7fa 100755 --- a/src/demos/es1/RedSquare.java +++ b/src/demos/es1/RedSquare.java @@ -41,7 +41,9 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo public void keyPressed(KeyEvent e) { System.out.println(glp+" "+e); - if(e.getKeyChar()=='q') { + if(e.getKeyChar()=='f') { + window.setFullscreen(!window.isFullscreen()); + } else if(e.getKeyChar()=='q') { quit = true; } } @@ -56,7 +58,9 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo System.out.println(glp+" mouseevent: "+e); switch(e.getClickCount()) { case 1: - window.setFullscreen(!window.isFullscreen()); + if(e.getButton()>MouseEvent.BUTTON1) { + window.setFullscreen(!window.isFullscreen()); + } break; default: quit=true; diff --git a/src/demos/es2/RedSquare.java b/src/demos/es2/RedSquare.java index 58c55c8..b0f86d1 100755 --- a/src/demos/es2/RedSquare.java +++ b/src/demos/es2/RedSquare.java @@ -43,7 +43,9 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo public void keyPressed(KeyEvent e) { System.out.println(glp+" "+e); - if(e.getKeyChar()=='q') { + if(e.getKeyChar()=='f') { + window.setFullscreen(!window.isFullscreen()); + } else if(e.getKeyChar()=='q') { quit = true; } } @@ -58,7 +60,9 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo System.out.println(glp+" mouseevent: "+e); switch(e.getClickCount()) { case 1: - window.setFullscreen(!window.isFullscreen()); + if(e.getButton()>MouseEvent.BUTTON1) { + window.setFullscreen(!window.isFullscreen()); + } break; default: quit=true; |