diff options
| author | Jeff Brown <jeffbrown@google.com> | 2011-01-04 19:57:47 -0800 |
|---|---|---|
| committer | Jeff Brown <jeffbrown@google.com> | 2011-01-05 14:51:24 -0800 |
| commit | 64da12ab1f472e01325b6c6d094153ac110eaf7b (patch) | |
| tree | 29b0e44f574a489ea8a5ce5062f244113538382d /core/java/android/view/Window.java | |
| parent | f31161a0e71c0446283610e9bf7a11e0be12bd5e (diff) | |
Add dispatch key shortcut window callback.
Enables Activities and Dialogs to implement key shortcut behavior.
Useful for global key shortcuts that are not bound to the focused
view or to a menu.
Change-Id: If377d20b227ee1c5cac84c47c9630b2d77f67e2c
Diffstat (limited to 'core/java/android/view/Window.java')
| -rw-r--r-- | core/java/android/view/Window.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java index 8446a8fd29be..2f27935dd331 100644 --- a/core/java/android/view/Window.java +++ b/core/java/android/view/Window.java @@ -150,6 +150,17 @@ public abstract class Window { public boolean dispatchKeyEvent(KeyEvent event); /** + * Called to process a key shortcut event. + * At the very least your implementation must call + * {@link android.view.Window#superDispatchKeyShortcutEvent} to do the + * standard key shortcut processing. + * + * @param event The key shortcut event. + * @return True if this event was consumed. + */ + public boolean dispatchKeyShortcutEvent(KeyEvent event); + + /** * Called to process touch screen events. At the very least your * implementation must call * {@link android.view.Window#superDispatchTouchEvent} to do the @@ -1028,6 +1039,14 @@ public abstract class Window { public abstract boolean superDispatchKeyEvent(KeyEvent event); /** + * Used by custom windows, such as Dialog, to pass the key shortcut press event + * further down the view hierarchy. Application developers should + * not need to implement or call this. + * + */ + public abstract boolean superDispatchKeyShortcutEvent(KeyEvent event); + + /** * Used by custom windows, such as Dialog, to pass the touch screen event * further down the view hierarchy. Application developers should * not need to implement or call this. |
