diff options
author | Sven Gothel <[email protected]> | 2012-10-26 16:43:13 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-10-26 16:43:13 +0200 |
commit | b008de41549e38aebdfcb7b094046235a8dde72f (patch) | |
tree | 4e51584207f22bd7203d1cc64bdab25e7a171eae /src/newt/classes/com | |
parent | 4f05d5add18048c2fbd1837c0563446c11177e8c (diff) |
Fix Bug 601 - Auto-Repeat Behavior: Adding unit tests for typed key order w/ and w/o auto repeat. Incl. fix for Windows.
Auto-Repeat tests recognizes whether auto-repeat could be triggered by AWT Robot.
The latter is not possible on Windows, hence manual testing was required on this platform.
Impact: X11, Windows and OSX produce proper key sequence incl. auto-repeat modifier mask.
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/event/KeyEvent.java | 11 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/event/NEWTEvent.java | 6 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java index 7daaeada6..b6f4264f5 100644 --- a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java +++ b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java @@ -48,6 +48,17 @@ package com.jogamp.newt.event; * Besides regular modifiers like {@link InputEvent#SHIFT_MASK} etc., * the {@link InputEvent#AUTOREPEAT_MASK} bit is added if repetition is detected. * </p> + * <p> + * Auto-Repeat shall behave as follow: + * <pre> + D = pressed, U = released, T = typed + 0 = normal, 1 = auto-repeat + + D(0), [ U(1), T(1), D(1), U(1) T(1) ..], U(0) T(0) + * </pre> + * The idea is if you mask out auto-repeat in your event listener + * you just get one long pressed key D/U/T triple. + * </p> */ @SuppressWarnings("serial") public class KeyEvent extends InputEvent diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java index fd5b69ccc..9d8d92ff6 100644 --- a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java +++ b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java @@ -161,11 +161,7 @@ public class NEWTEvent extends java.util.EventObject { return sb.append("NEWTEvent[sys:").append(isSystemEvent()).append(", source:").append(getSource().getClass().getName()).append(", when:").append(getWhen()).append(" d ").append((System.currentTimeMillis()-getWhen())).append("ms]"); } - public static String toHexString(int hex) { + static String toHexString(int hex) { return "0x" + Integer.toHexString(hex); } - - public static String toHexString(long hex) { - return "0x" + Long.toHexString(hex); - } } |