summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/WindowManagerPolicy.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/view/WindowManagerPolicy.java')
-rw-r--r--core/java/android/view/WindowManagerPolicy.java29
1 files changed, 23 insertions, 6 deletions
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java
index e78d6a8..4deff5e 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -568,12 +568,8 @@ public interface WindowManagerPolicy {
* Called from the input dispatcher thread before a key is dispatched to a window.
*
* <p>Allows you to define
- * behavior for keys that can not be overridden by applications or redirect
- * key events to a different window. This method is called from the
- * input thread, with no locks held.
- *
- * <p>Note that if you change the window a key is dispatched to, the new
- * target window will receive the key event without having input focus.
+ * behavior for keys that can not be overridden by applications.
+ * This method is called from the input thread, with no locks held.
*
* @param win The window that currently has focus. This is where the key
* event will normally go.
@@ -591,6 +587,27 @@ public interface WindowManagerPolicy {
int keyCode, int scanCode, int metaState, int repeatCount, int policyFlags);
/**
+ * Called from the input dispatcher thread when an application did not handle
+ * a key that was dispatched to it.
+ *
+ * <p>Allows you to define default global behavior for keys that were not handled
+ * by applications. This method is called from the input thread, with no locks held.
+ *
+ * @param win The window that currently has focus. This is where the key
+ * event will normally go.
+ * @param action The key event action.
+ * @param flags The key event flags.
+ * @param keyCode The key code.
+ * @param scanCode The key's scan code.
+ * @param metaState bit mask of meta keys that are held.
+ * @param repeatCount Number of times a key down has repeated.
+ * @param policyFlags The policy flags associated with the key.
+ * @return Returns true if the policy consumed the event.
+ */
+ public boolean dispatchUnhandledKey(WindowState win, int action, int flags,
+ int keyCode, int scanCode, int metaState, int repeatCount, int policyFlags);
+
+ /**
* Called when layout of the windows is about to start.
*
* @param displayWidth The current full width of the screen.