diff options
author | Sven Gothel <[email protected]> | 2013-03-21 20:40:41 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-03-21 20:40:41 +0100 |
commit | 58ebd43a78491281e2c3b012666220ed47634c7e (patch) | |
tree | 8f092d3dbf158c8173d9d95024df63ca37a59d19 /src/newt/classes/com | |
parent | 98f6f99ddc6643cfa540d6c85c64c7f8510cc1ea (diff) |
NEWT/Android: Fix BACK button implementation, use different KeyCode mappings and allowing native action to be suppressed.
- Don't trust soft-kbd visibility state, but perform invisible action. If the latter
was successful - soft-kbd was visible before.
- Map BACK to VK_KEYBOARD_INVISIBLE and propagate it,
if soft-kbd was visible before.
No native default action is performed.
- Map BACK to VK_ESCAPE event and propagate it,
if soft-kbd was invisible _and_ an activity was registered via registerActivity(Activity),
i.e. by NewtBaseActivity.
Otherwise proceed w/ default action (-> activity.finish()).
- If the KeyListener consumed the [EVENT_KEY_RELEASED, VK_ESCAPE] event,
it will be suppressed and no default action performed.
This allows applications to have a custom 'ESCAPE' or 'BACK' handling.
Otherwise (not consumed) the default action is performed.
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/event/NEWTEvent.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java index 67bc73652..12a2e3dc2 100644 --- a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java +++ b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java @@ -137,7 +137,7 @@ public class NEWTEvent extends java.util.EventObject { if(null == sb) { sb = new StringBuilder(); } - return sb.append("NEWTEvent[source:").append(getSource().getClass().getName()).append(", when:").append(getWhen()).append(" d ").append((System.currentTimeMillis()-getWhen())).append("ms]"); + return sb.append("NEWTEvent[source:").append(getSource().getClass().getName()).append("consumed ").append(isConsumed()).append(", when:").append(getWhen()).append(" d ").append((System.currentTimeMillis()-getWhen())).append("ms]"); } public static String toHexString(short hex) { |