From 2f9c77a347b76bebdadd4bec1ac92aa7ab72365f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 27 Oct 2012 02:48:43 +0200 Subject: Fix Bug 631 and enhance 601: Handle multiple keys (pressed, released, types incl. auto-repeat) - Using keyCode (bit) maps to isPressed and isAutoRepeat, allowing use of multiple keys - Enhance unit test TestKeyEventOrderNEWT w/ injecting variations of 2 diff. keys - Manual tested on X11, Windows and OSX w/ and w/o auto-repeat --- .../test/junit/newt/TestKeyEventOrderNEWT.java | 22 +- .../newt/TestKeyPressReleaseUnmaskRepeatNEWT.java | 222 +++++++++++++++++++++ .../jogamp/opengl/test/junit/util/NEWTKeyUtil.java | 8 +- 3 files changed, 248 insertions(+), 4 deletions(-) create mode 100644 src/test/com/jogamp/opengl/test/junit/newt/TestKeyPressReleaseUnmaskRepeatNEWT.java (limited to 'src/test/com/jogamp/opengl') diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestKeyEventOrderNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestKeyEventOrderNEWT.java index e0c3005a2..31d9912d1 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestKeyEventOrderNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestKeyEventOrderNEWT.java @@ -141,17 +141,33 @@ public class TestKeyEventOrderNEWT extends UITestCase { System.err.println("KEY Event Order Test: "+loops); keyAdapter.reset(); for(int i=0; i keyEvents) { - int eet = KeyEvent.EVENT_KEY_PRESSED; + IntIntHashMap keyCode2NextEvent = new IntIntHashMap(); for(int i=0; i= eet ) { + eet = KeyEvent.EVENT_KEY_PRESSED; + } final int et = e.getEventType(); Assert.assertEquals("Key event not in proper order", eet, et); eet = getNextKeyEventType(et); + keyCode2NextEvent.put(e.getKeyCode(), eet); } } -- cgit v1.2.3