aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-06-17 09:01:23 +0200
committerSven Gothel <[email protected]>2013-06-17 09:01:23 +0200
commit8b33170ec6fd3f215976875cb66d746fa1b48f61 (patch)
tree3e5c72feb9ed33fc1b81a073f92adb43f21836ce /src/newt/classes/jogamp
parentc24f44036971bf58b5c47a6e1f7d9f186c67e789 (diff)
Fix Bug 688: Removal of NEWT KeyEvent.EVENT_KEY_TYPED and KeyListener.keyTyped(KeyEvent)
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java34
1 files changed, 1 insertions, 33 deletions
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 805ad08ad..dca287c6b 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -2476,7 +2476,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return keyListeners.toArray(new KeyListener[keyListeners.size()]);
}
- @SuppressWarnings("deprecation")
private final boolean propagateKeyEvent(KeyEvent e, KeyListener l) {
switch(e.getEventType()) {
case KeyEvent.EVENT_KEY_PRESSED:
@@ -2485,40 +2484,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
case KeyEvent.EVENT_KEY_RELEASED:
l.keyReleased(e);
break;
- case KeyEvent.EVENT_KEY_TYPED:
- l.keyTyped(e);
- break;
default:
throw new NativeWindowException("Unexpected key event type " + e.getEventType());
}
return e.isConsumed();
}
- @SuppressWarnings("deprecation")
protected void consumeKeyEvent(KeyEvent e) {
- boolean consumedE = false, consumedTyped = false;
- if( KeyEvent.EVENT_KEY_TYPED == e.getEventType() ) {
- throw new InternalError("Deprecated KeyEvent.EVENT_KEY_TYPED is synthesized - don't send/enqueue it!");
- }
-
- // Synthesize deprecated event KeyEvent.EVENT_KEY_TYPED
- final KeyEvent eTyped;
- if( KeyEvent.EVENT_KEY_RELEASED == e.getEventType() && e.isPrintableKey() && !e.isAutoRepeat() ) {
- eTyped = KeyEvent.create(KeyEvent.EVENT_KEY_TYPED, e.getSource(), e.getWhen(), e.getModifiers(), e.getKeyCode(), e.getKeySymbol(), e.getKeyChar());
- } else {
- eTyped = null;
- }
+ boolean consumedE = false;
if(null != keyboardFocusHandler) {
consumedE = propagateKeyEvent(e, keyboardFocusHandler);
if(DEBUG_KEY_EVENT) {
System.err.println("consumeKeyEvent: "+e+", keyboardFocusHandler consumed: "+consumedE);
}
- if( null != eTyped ) {
- consumedTyped = propagateKeyEvent(eTyped, keyboardFocusHandler);
- if(DEBUG_KEY_EVENT) {
- System.err.println("consumeKeyEvent: "+eTyped+", keyboardFocusHandler consumed: "+consumedTyped);
- }
- }
}
if(DEBUG_KEY_EVENT) {
if( !consumedE ) {
@@ -2528,16 +2506,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
for(int i = 0; !consumedE && i < keyListeners.size(); i++ ) {
consumedE = propagateKeyEvent(e, keyListeners.get(i));
}
- if( null != eTyped ) {
- if(DEBUG_KEY_EVENT) {
- if( !consumedTyped ) {
- System.err.println("consumeKeyEvent: "+eTyped);
- }
- }
- for(int i = 0; !consumedTyped && i < keyListeners.size(); i++ ) {
- consumedTyped = propagateKeyEvent(eTyped, keyListeners.get(i));
- }
- }
}
//