From 58ebd43a78491281e2c3b012666220ed47634c7e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 21 Mar 2013 20:40:41 +0100 Subject: 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. --- src/newt/classes/com/jogamp/newt/event/NEWTEvent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/newt/classes/com/jogamp') 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) { -- cgit v1.2.3