java.lang.Object | ||
android.view.KeyEvent | Parcelable |
Value | ||||
---|---|---|---|---|
int | ACTION_DOWN | getAction() value: the key has been pressed down. | 0 | 0x00000000 |
int | ACTION_MULTIPLE | getAction() value: multiple duplicate key events have occurred in a row. | 2 | 0x00000002 |
int | ACTION_UP | getAction() value: the key has been released. | 1 | 0x00000001 |
Creator<KeyEvent> | CREATOR | |||
int | FLAG_WOKE_HERE | This mask is set if the device woke because of this key event. | 1 | 0x00000001 |
int | KEYCODE_0 | 7 | 0x00000007 | |
int | KEYCODE_1 | 8 | 0x00000008 | |
int | KEYCODE_2 | 9 | 0x00000009 | |
int | KEYCODE_3 | 10 | 0x0000000a | |
int | KEYCODE_4 | 11 | 0x0000000b | |
int | KEYCODE_5 | 12 | 0x0000000c | |
int | KEYCODE_6 | 13 | 0x0000000d | |
int | KEYCODE_7 | 14 | 0x0000000e | |
int | KEYCODE_8 | 15 | 0x0000000f | |
int | KEYCODE_9 | 16 | 0x00000010 | |
int | KEYCODE_A | 29 | 0x0000001d | |
int | KEYCODE_ALT_LEFT | 57 | 0x00000039 | |
int | KEYCODE_ALT_RIGHT | 58 | 0x0000003a | |
int | KEYCODE_APOSTROPHE | 75 | 0x0000004b | |
int | KEYCODE_AT | 77 | 0x0000004d | |
int | KEYCODE_B | 30 | 0x0000001e | |
int | KEYCODE_BACK | 4 | 0x00000004 | |
int | KEYCODE_BACKSLASH | 73 | 0x00000049 | |
int | KEYCODE_C | 31 | 0x0000001f | |
int | KEYCODE_CALL | 5 | 0x00000005 | |
int | KEYCODE_CAMERA | 27 | 0x0000001b | |
int | KEYCODE_CLEAR | 28 | 0x0000001c | |
int | KEYCODE_COMMA | 55 | 0x00000037 | |
int | KEYCODE_D | 32 | 0x00000020 | |
int | KEYCODE_DEL | 67 | 0x00000043 | |
int | KEYCODE_DPAD_CENTER | 23 | 0x00000017 | |
int | KEYCODE_DPAD_DOWN | 20 | 0x00000014 | |
int | KEYCODE_DPAD_LEFT | 21 | 0x00000015 | |
int | KEYCODE_DPAD_RIGHT | 22 | 0x00000016 | |
int | KEYCODE_DPAD_UP | 19 | 0x00000013 | |
int | KEYCODE_E | 33 | 0x00000021 | |
int | KEYCODE_ENDCALL | 6 | 0x00000006 | |
int | KEYCODE_ENTER | 66 | 0x00000042 | |
int | KEYCODE_ENVELOPE | 65 | 0x00000041 | |
int | KEYCODE_EQUALS | 70 | 0x00000046 | |
int | KEYCODE_EXPLORER | 64 | 0x00000040 | |
int | KEYCODE_F | 34 | 0x00000022 | |
int | KEYCODE_FOCUS | 80 | 0x00000050 | |
int | KEYCODE_G | 35 | 0x00000023 | |
int | KEYCODE_GRAVE | 68 | 0x00000044 | |
int | KEYCODE_H | 36 | 0x00000024 | |
int | KEYCODE_HEADSETHOOK | 79 | 0x0000004f | |
int | KEYCODE_HOME | 3 | 0x00000003 | |
int | KEYCODE_I | 37 | 0x00000025 | |
int | KEYCODE_J | 38 | 0x00000026 | |
int | KEYCODE_K | 39 | 0x00000027 | |
int | KEYCODE_L | 40 | 0x00000028 | |
int | KEYCODE_LEFT_BRACKET | 71 | 0x00000047 | |
int | KEYCODE_M | 41 | 0x00000029 | |
int | KEYCODE_MENU | 82 | 0x00000052 | |
int | KEYCODE_MINUS | 69 | 0x00000045 | |
int | KEYCODE_N | 42 | 0x0000002a | |
int | KEYCODE_NOTIFICATION | 83 | 0x00000053 | |
int | KEYCODE_NUM | 78 | 0x0000004e | |
int | KEYCODE_O | 43 | 0x0000002b | |
int | KEYCODE_P | 44 | 0x0000002c | |
int | KEYCODE_PERIOD | 56 | 0x00000038 | |
int | KEYCODE_PLUS | 81 | 0x00000051 | |
int | KEYCODE_POUND | 18 | 0x00000012 | |
int | KEYCODE_POWER | 26 | 0x0000001a | |
int | KEYCODE_Q | 45 | 0x0000002d | |
int | KEYCODE_R | 46 | 0x0000002e | |
int | KEYCODE_RIGHT_BRACKET | 72 | 0x00000048 | |
int | KEYCODE_S | 47 | 0x0000002f | |
int | KEYCODE_SEARCH | 84 | 0x00000054 | |
int | KEYCODE_SEMICOLON | 74 | 0x0000004a | |
int | KEYCODE_SHIFT_LEFT | 59 | 0x0000003b | |
int | KEYCODE_SHIFT_RIGHT | 60 | 0x0000003c | |
int | KEYCODE_SLASH | 76 | 0x0000004c | |
int | KEYCODE_SOFT_LEFT | 1 | 0x00000001 | |
int | KEYCODE_SOFT_RIGHT | 2 | 0x00000002 | |
int | KEYCODE_SPACE | 62 | 0x0000003e | |
int | KEYCODE_STAR | 17 | 0x00000011 | |
int | KEYCODE_SYM | 63 | 0x0000003f | |
int | KEYCODE_T | 48 | 0x00000030 | |
int | KEYCODE_TAB | 61 | 0x0000003d | |
int | KEYCODE_U | 49 | 0x00000031 | |
int | KEYCODE_UNKNOWN | 0 | 0x00000000 | |
int | KEYCODE_V | 50 | 0x00000032 | |
int | KEYCODE_VOLUME_DOWN | 25 | 0x00000019 | |
int | KEYCODE_VOLUME_UP | 24 | 0x00000018 | |
int | KEYCODE_W | 51 | 0x00000033 | |
int | KEYCODE_X | 52 | 0x00000034 | |
int | KEYCODE_Y | 53 | 0x00000035 | |
int | KEYCODE_Z | 54 | 0x00000036 | |
int | MAX_KEYCODE | 84 | 0x00000054 | |
int | META_ALT_LEFT_ON | This mask is used to check whether the left ALT meta key is pressed. |
16 | 0x00000010 |
int | META_ALT_ON | This mask is used to check whether one of the ALT meta keys is pressed. |
2 | 0x00000002 |
int | META_ALT_RIGHT_ON | This mask is used to check whether the right the ALT meta key is pressed. |
32 | 0x00000020 |
int | META_SHIFT_LEFT_ON | This mask is used to check whether the left SHIFT meta key is pressed. |
64 | 0x00000040 |
int | META_SHIFT_ON | This mask is used to check whether one of the SHIFT meta keys is pressed. |
1 | 0x00000001 |
int | META_SHIFT_RIGHT_ON | This mask is used to check whether the right SHIFT meta key is pressed. |
128 | 0x00000080 |
int | META_SYM_ON | This mask is used to check whether the SYM meta key is pressed. |
4 | 0x00000004 |
KeyEvent(int action, int code) | ||||||
Create a new key event. | ||||||
KeyEvent(long downTime, long eventTime, int action, int code, int repeat) | ||||||
Create a new key event. | ||||||
KeyEvent(long downTime, long eventTime, int action, int code, int repeat, int metaState) | ||||||
Create a new key event. | ||||||
KeyEvent(long downTime, long eventTime, int action, int code, int repeat, int metaState, int device, int scancode) | ||||||
Create a new key event. | ||||||
KeyEvent(long downTime, long eventTime, int action, int code, int repeat, int metaState, int device, int scancode, int flags) | ||||||
Create a new key event. | ||||||
KeyEvent(KeyEvent origEvent, long eventTime, int newRepeat) | ||||||
Copy an existing key event, modifying its time and repeat count. |
int | describeContents() | |||||
Describe the kinds of special objects contained in this Parcelable's marshalled representation. | ||||||
final | boolean | dispatch(KeyEvent.Callback receiver) | ||||
Deliver this key event to a KeyEvent.Callback interface. | ||||||
final | int | getAction() | ||||
Retrieve the action of this key event. | ||||||
static | int | getDeadChar(int accent, int c) | ||||
Get the character that is produced by putting accent on the character c. | ||||||
final | int | getDeviceId() | ||||
Return the id for the keyboard that this event came from. | ||||||
char | getDisplayLabel() | |||||
Get the primary character for this key. | ||||||
final | long | getDownTime() | ||||
Retrieve the time of the most recent key down event, in the uptimeMillis() time base. | ||||||
final | long | getEventTime() | ||||
Retrieve the time this event occurred, in the uptimeMillis() time base. | ||||||
final | int | getFlags() | ||||
Returns the flags for this key event. | ||||||
final | int | getKeyCode() | ||||
Retrieve the key code of the key event. | ||||||
boolean | getKeyData(KeyCharacterMap.KeyData results) | |||||
Get the characters conversion data for the key event.. | ||||||
final | int | getKeyboardDevice() | ||||
Renamed to getDeviceId(). | ||||||
char | getMatch(char[] chars, int modifiers) | |||||
If one of the chars in the array can be generated by the keyCode of this key event, return the char; otherwise return '\0'. | ||||||
char | getMatch(char[] chars) | |||||
The same as getMatch(chars, 0). | ||||||
final | int | getMetaState() | ||||
Returns the state of the meta keys. |
||||||
char | getNumber() | |||||
Gets the number or symbol associated with the key. | ||||||
final | int | getRepeatCount() | ||||
Retrieve the repeat count of the event. | ||||||
final | int | getScanCode() | ||||
Retrieve the hardware key id of this key event. These values are not reliable and vary from device to device. | ||||||
int | getUnicodeChar(int meta) | |||||
Returns the Unicode character that the key would produce. |
||||||
int | getUnicodeChar() | |||||
Returns the Unicode character that the key would produce. |
||||||
final | boolean | isAltPressed() | ||||
Returns the pressed state of the ALT meta key. |
||||||
final | boolean | isDown() | ||||
Don't use in new code, instead explicitly check getAction(). | ||||||
static | boolean | isModifierKey(int keyCode) | ||||
Returns true if this key code is a modifier key. | ||||||
boolean | isPrintingKey() | |||||
Does the key code of this key produce a glyph? | ||||||
final | boolean | isShiftPressed() | ||||
Returns the pressed state of the SHIFT meta key. |
||||||
final | boolean | isSymPressed() | ||||
Returns the pressed state of the SYM meta key. |
||||||
final | boolean | isSystem() | ||||
Is this a system key? System keys can not be used for menu shortcuts. | ||||||
String | toString() | |||||
Returns a string containing a concise, human-readable description of the receiver. | ||||||
void | writeToParcel(Parcel out, int flags) | |||||
Flatten this object in to a Parcel. |
This mask is used to check whether the left ALT meta key is pressed.
This mask is used to check whether one of the ALT meta keys is pressed.
This mask is used to check whether the right the ALT meta key is pressed.
This mask is used to check whether the left SHIFT meta key is pressed.
This mask is used to check whether one of the SHIFT meta keys is pressed.
This mask is used to check whether the right SHIFT meta key is pressed.
This mask is used to check whether the SYM meta key is pressed.
action | Action code: either ACTION_DOWN, ACTION_UP, or ACTION_MULTIPLE. |
---|---|
code | The key code. |
downTime | The time (in uptimeMillis()) at which this key code originally went down. |
---|---|
eventTime | The time (in uptimeMillis()) at which this event happened. |
action | Action code: either ACTION_DOWN, ACTION_UP, or ACTION_MULTIPLE. |
code | The key code. |
repeat | A repeat count for down events (> 0 if this is after the initial down) or event count for multiple events. |
downTime | The time (in uptimeMillis()) at which this key code originally went down. |
---|---|
eventTime | The time (in uptimeMillis()) at which this event happened. |
action | Action code: either ACTION_DOWN, ACTION_UP, or ACTION_MULTIPLE. |
code | The key code. |
repeat | A repeat count for down events (> 0 if this is after the initial down) or event count for multiple events. |
metaState | Flags indicating which meta keys are currently pressed. |
downTime | The time (in uptimeMillis()) at which this key code originally went down. |
---|---|
eventTime | The time (in uptimeMillis()) at which this event happened. |
action | Action code: either ACTION_DOWN, ACTION_UP, or ACTION_MULTIPLE. |
code | The key code. |
repeat | A repeat count for down events (> 0 if this is after the initial down) or event count for multiple events. |
metaState | Flags indicating which meta keys are currently pressed. |
device | The device ID that generated the key event. |
scancode | Raw device scan code of the event. |
downTime | The time (in uptimeMillis()) at which this key code originally went down. |
---|---|
eventTime | The time (in uptimeMillis()) at which this event happened. |
action | Action code: either ACTION_DOWN, ACTION_UP, or ACTION_MULTIPLE. |
code | The key code. |
repeat | A repeat count for down events (> 0 if this is after the initial down) or event count for multiple events. |
metaState | Flags indicating which meta keys are currently pressed. |
device | The device ID that generated the key event. |
scancode | Raw device scan code of the event. |
flags | The flags for this key event |
origEvent | The existing event to be copied. |
---|---|
eventTime | The new event time (in uptimeMillis()) of the event. |
newRepeat | The new repeat count of the event. |
receiver | The Callback that will be given the event. |
---|
results | a KeyCharacterMap.KeyData that will be filled with the results. |
---|
chars | the characters to try to find |
---|---|
modifiers | the modifier bits to prefer. If any of these bits are set, if there are multiple choices, that could work, the one for this modifier will be set. |
Returns the state of the meta keys.
Mostly this is here for debugging purposes.
Returns the Unicode character that the key would produce.
Returns 0 if the key is not one that is used to type Unicode characters.
If the return value has bit COMBINING_ACCENT set, the key is a "dead key" that should be combined with another to actually produce a character -- see getDeadChar(int, int) -- after masking with COMBINING_ACCENT_MASK.
Returns the Unicode character that the key would produce.
Returns 0 if the key is not one that is used to type Unicode characters.
If the return value has bit COMBINING_ACCENT set, the key is a "dead key" that should be combined with another to actually produce a character -- see getDeadChar(int, int) -- after masking with COMBINING_ACCENT_MASK.
Returns the pressed state of the ALT meta key.
Returns the pressed state of the SHIFT meta key.
Returns the pressed state of the SYM meta key.
Copyright 2007 Google Inc. | Build 0.9_r1-98467 - 14 Aug 2008 18:48 |