diff options
author | Sven Gothel <[email protected]> | 2013-07-03 18:33:15 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-07-03 18:33:15 +0200 |
commit | 3856dcc14f0f27a37930ec3f085746ed91d72cff (patch) | |
tree | 457e5b7affc3161ddc3fa98d679c3712bd177908 /src | |
parent | de2905a6fce37e7caf69b148ef4cf7f347559530 (diff) |
WindowImpl.consumeKeyEvent: Reduce DEBUG println and show println after propagating event to show whether it has been consumed.
Diffstat (limited to 'src')
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 16 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 600035bf6..f449d185f 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -2567,16 +2567,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer if( null != keyboardFocusHandler && !e.isAutoRepeat() ) { consumedE = propagateKeyEvent(e, keyboardFocusHandler); if(DEBUG_KEY_EVENT) { - System.err.println("consumeKeyEvent(kfh): "+e+", keyboardFocusHandler consumed: "+consumedE); + if( consumedE ) { + System.err.println("consumeKeyEvent(kfh): "+e+", consumed: "+consumedE); + } } } - if(DEBUG_KEY_EVENT) { - if( !consumedE ) { - System.err.println("consumeKeyEvent(usr): "+e); + if( !consumedE ) { + for(int i = 0; !consumedE && i < keyListeners.size(); i++ ) { + consumedE = propagateKeyEvent(e, keyListeners.get(i)); + } + if(DEBUG_KEY_EVENT) { + System.err.println("consumeKeyEvent(usr): "+e+", consumed: "+consumedE); } - } - for(int i = 0; !consumedE && i < keyListeners.size(); i++ ) { - consumedE = propagateKeyEvent(e, keyListeners.get(i)); } } diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java index 7a8e683af..393445db0 100644 --- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java +++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java @@ -291,7 +291,7 @@ public class WindowDriver extends WindowImpl { public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) { final boolean isModifierKey = KeyEvent.isModifierKey(keySym); // System.err.println("*** sendKeyEvent: event "+KeyEvent.getEventTypeString(eventType)+", keyCode "+toHexString(keyCode)+", keyChar <"+keyChar+">, mods "+toHexString(modifiers)+ - // ", isKeyCodeTracked "+isKeyCodeTracked(keyCode)+", was: pressed "+isKeyPressed(keyCode)+", repeat "+isKeyInAutoRepeat(keyCode)+", printableKey "+KeyEvent.isPrintableKey(keyCode)+" [modifierKey "+isModifierKey+"] - "+System.currentTimeMillis()); + // ", isKeyCodeTracked "+isKeyCodeTracked(keyCode)+", was: pressed "+isKeyPressed(keyCode)+", printableKey "+KeyEvent.isPrintableKey(keyCode, false)+" [modifierKey "+isModifierKey+"] - "+System.currentTimeMillis()); // Reorder: WINDOWS delivery order is PRESSED (t0), TYPED (t0) and RELEASED (t1) -> NEWT order: PRESSED (t0) and RELEASED (t1) // Auto-Repeat: WINDOWS delivers only PRESSED (t0) and TYPED (t0). |