summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/KeyEvent.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-12-06 17:13:33 -0800
committerJeff Brown <jeffbrown@google.com>2010-12-07 17:35:26 -0800
commit49ed71db425c5054e3ad9526496a7e116c89556b (patch)
tree3d3b28bdaf76d5cc531fd3b52fcbb0efb32a05ba /core/java/android/view/KeyEvent.java
parentf30c8287525ac049d4d7589a330be5713256046b (diff)
downloadframeworks_base-49ed71db425c5054e3ad9526496a7e116c89556b.zip
frameworks_base-49ed71db425c5054e3ad9526496a7e116c89556b.tar.gz
frameworks_base-49ed71db425c5054e3ad9526496a7e116c89556b.tar.bz2
Add support for fallback keycodes.
This change enables the framework to synthesize key events to implement default behavior when an application does not handle a key. For example, this change enables numeric keypad keys to perform their associated special function when numlock is off. The application is informed that it is processing a fallback keypress so it can choose to ignore it. Added a new keycode for switching applications. Added ALT key deadkeys. New default key mappings: - ESC -> BACK - Meta+ESC -> HOME - Alt+ESC -> MENU - Meta+Space -> SEARCH - Meta+Tab -> APP_SWITCH Fixed some comments. Fixed some tests. Change-Id: Id7f3b6645f3a350275e624547822f72652f3defe
Diffstat (limited to 'core/java/android/view/KeyEvent.java')
-rwxr-xr-xcore/java/android/view/KeyEvent.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java
index 03407a3..43b77e6 100755
--- a/core/java/android/view/KeyEvent.java
+++ b/core/java/android/view/KeyEvent.java
@@ -529,15 +529,17 @@ public class KeyEvent extends InputEvent implements Parcelable {
/** Key code constant: Blue "programmable" key.
* On TV remotes, acts as a contextual/programmable key. */
public static final int KEYCODE_PROG_BLUE = 186;
+ /** Key code constant: App switch key.
+ * Should bring up the application switcher dialog. */
+ public static final int KEYCODE_APP_SWITCH = 187;
- private static final int LAST_KEYCODE = KEYCODE_PROG_BLUE;
+ private static final int LAST_KEYCODE = KEYCODE_APP_SWITCH;
// NOTE: If you add a new keycode here you must also add it to:
// isSystem()
// native/include/android/keycodes.h
// frameworks/base/include/ui/KeycodeLabels.h
// external/webkit/WebKit/android/plugins/ANPKeyCodes.h
- // tools/puppet_master/PuppetMaster/nav_keys.py
// frameworks/base/core/res/res/values/attrs.xml
// emulator?
//
@@ -737,6 +739,7 @@ public class KeyEvent extends InputEvent implements Parcelable {
"KEYCODE_PROG_GREEN",
"KEYCODE_PROG_YELLOW",
"KEYCODE_PROG_BLUE",
+ "KEYCODE_APP_SWITCH",
};
// Symbolic names of all metakeys in bit order from least significant to most significant.
@@ -1056,7 +1059,17 @@ public class KeyEvent extends InputEvent implements Parcelable {
* the tracking to be canceled.
*/
public static final int FLAG_TRACKING = 0x200;
-
+
+ /**
+ * Set when a key event has been synthesized to implement default behavior
+ * for an event that the application did not handle.
+ * Fallback key events are generated by unhandled trackball motions
+ * (to emulate a directional keypad) and by certain unhandled key presses
+ * that are declared in the key map (such as special function numeric keypad
+ * keys when numlock is off).
+ */
+ public static final int FLAG_FALLBACK = 0x400;
+
/**
* Private control to determine when an app is tracking a key sequence.
* @hide