From 09ebc2cd6fdd317134f0afb38174418a6d067d65 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 8 Apr 2013 23:04:49 +0200 Subject: Bug 641 NEWT: Refine definition of keySym, i.e. for printable keys, keySym is the 'unshifted' UTF-16 char value ; Add isPrintable() to toString(). --- src/newt/classes/com/jogamp/newt/event/KeyEvent.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/newt/classes/com') diff --git a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java index a3613fe2e..bda60004e 100644 --- a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java +++ b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java @@ -112,6 +112,11 @@ public class KeyEvent extends InputEvent /** * Returns the virtual key symbol reflecting the current keyboard layout. + *

+ * For {@link #isPrintableKey() printable keys}, the key symbol is the unshifted + * representation of the {@link #getKeyChar() UTF-16 key char}. + *

+ * @see #isPrintableKey() * @see #getKeyChar() * @see #getKeyCode() */ @@ -151,7 +156,7 @@ public class KeyEvent extends InputEvent sb = new StringBuilder(); } sb.append("KeyEvent[").append(getEventTypeString(getEventType())).append(", code ").append(toHexString(keyCode)).append(", sym ").append(toHexString(keySym)).append(", char '").append(keyChar).append("' (").append(toHexString((short)keyChar)) - .append("), isModifierKey ").append(isModifierKey()).append(", isActionKey ").append(isActionKey()).append(", "); + .append("), printable ").append(isPrintableKey()).append(", modifier ").append(isModifierKey()).append(", action ").append(isActionKey()).append(", "); return super.toString(sb).append("]"); } -- cgit v1.2.3