Example usage for Java android.view KeyEvent fields, constructors, methods, implement or subclass
The text is from its open source code.
int | KEYCODE_UNKNOWN Key code constant: Unknown key code. |
int | KEYCODE_SOFT_LEFT Key code constant: Soft Left key. |
int | KEYCODE_SOFT_RIGHT Key code constant: Soft Right key. |
int | KEYCODE_HOME Key code constant: Home key. |
int | KEYCODE_BACK Key code constant: Back key. |
int | KEYCODE_CALL Key code constant: Call key. |
int | KEYCODE_ENDCALL Key code constant: End Call key. |
int | KEYCODE_0 Key code constant: '0' key. |
int | KEYCODE_1 Key code constant: '1' key. |
int | KEYCODE_2 Key code constant: '2' key. |
int | KEYCODE_3 Key code constant: '3' key. |
int | KEYCODE_4 Key code constant: '4' key. |
int | KEYCODE_5 Key code constant: '5' key. |
int | KEYCODE_6 Key code constant: '6' key. |
int | KEYCODE_7 Key code constant: '7' key. |
int | KEYCODE_8 Key code constant: '8' key. |
int | KEYCODE_9 Key code constant: '9' key. |
int | KEYCODE_STAR Key code constant: '*' key. |
int | KEYCODE_POUND Key code constant: '#' key. |
int | KEYCODE_DPAD_UP Key code constant: Directional Pad Up key. |
int | KEYCODE_DPAD_DOWN Key code constant: Directional Pad Down key. |
int | KEYCODE_DPAD_LEFT Key code constant: Directional Pad Left key. |
int | KEYCODE_DPAD_RIGHT Key code constant: Directional Pad Right key. |
int | KEYCODE_DPAD_CENTER Key code constant: Directional Pad Center key. |
int | KEYCODE_VOLUME_UP Key code constant: Volume Up key. |
int | KEYCODE_VOLUME_DOWN Key code constant: Volume Down key. |
int | KEYCODE_POWER Key code constant: Power key. |
int | KEYCODE_CAMERA Key code constant: Camera key. |
int | KEYCODE_CLEAR Key code constant: Clear key. |
int | KEYCODE_A Key code constant: 'A' key. |
int | KEYCODE_B Key code constant: 'B' key. |
int | KEYCODE_C Key code constant: 'C' key. |
int | KEYCODE_D Key code constant: 'D' key. |
int | KEYCODE_E Key code constant: 'E' key. |
int | KEYCODE_F Key code constant: 'F' key. |
int | KEYCODE_G Key code constant: 'G' key. |
int | KEYCODE_H Key code constant: 'H' key. |
int | KEYCODE_I Key code constant: 'I' key. |
int | KEYCODE_J Key code constant: 'J' key. |
int | KEYCODE_K Key code constant: 'K' key. |
int | KEYCODE_L Key code constant: 'L' key. |
int | KEYCODE_M Key code constant: 'M' key. |
int | KEYCODE_N Key code constant: 'N' key. |
int | KEYCODE_O Key code constant: 'O' key. |
int | KEYCODE_P Key code constant: 'P' key. |
int | KEYCODE_Q Key code constant: 'Q' key. |
int | KEYCODE_R Key code constant: 'R' key. |
int | KEYCODE_S Key code constant: 'S' key. |
int | KEYCODE_T Key code constant: 'T' key. |
int | KEYCODE_U Key code constant: 'U' key. |
int | KEYCODE_V Key code constant: 'V' key. |
int | KEYCODE_W Key code constant: 'W' key. |
int | KEYCODE_X Key code constant: 'X' key. |
int | KEYCODE_Y Key code constant: 'Y' key. |
int | KEYCODE_Z Key code constant: 'Z' key. |
int | KEYCODE_COMMA Key code constant: ',' key. |
int | KEYCODE_PERIOD Key code constant: '.' |
int | KEYCODE_ALT_LEFT Key code constant: Left Alt modifier key. |
int | KEYCODE_ALT_RIGHT Key code constant: Right Alt modifier key. |
int | KEYCODE_SHIFT_LEFT Key code constant: Left Shift modifier key. |
int | KEYCODE_SHIFT_RIGHT Key code constant: Right Shift modifier key. |
int | KEYCODE_TAB Key code constant: Tab key. |
int | KEYCODE_SPACE Key code constant: Space key. |
int | KEYCODE_SYM Key code constant: Symbol modifier key. |
int | KEYCODE_EXPLORER Key code constant: Explorer special function key. |
int | KEYCODE_ENVELOPE Key code constant: Envelope special function key. |
int | KEYCODE_ENTER Key code constant: Enter key. |
int | KEYCODE_DEL Key code constant: Backspace key. |
int | KEYCODE_GRAVE Key code constant: '`' (backtick) key. |
int | KEYCODE_MINUS Key code constant: '-'. |
int | KEYCODE_EQUALS Key code constant: '=' key. |
int | KEYCODE_LEFT_BRACKET Key code constant: '[' key. |
int | KEYCODE_RIGHT_BRACKET Key code constant: ']' key. |
int | KEYCODE_BACKSLASH Key code constant: '\' key. |
int | KEYCODE_SEMICOLON Key code constant: ';' key. |
int | KEYCODE_APOSTROPHE Key code constant: ''' (apostrophe) key. |
int | KEYCODE_SLASH Key code constant: '/' key. |
int | KEYCODE_AT Key code constant: '@' key. |
int | KEYCODE_NUM Key code constant: Number modifier key. |
int | KEYCODE_HEADSETHOOK Key code constant: Headset Hook key. |
int | KEYCODE_FOCUS Key code constant: Camera Focus key. |
int | KEYCODE_PLUS Key code constant: '+' key. |
int | KEYCODE_MENU Key code constant: Menu key. |
int | KEYCODE_NOTIFICATION Key code constant: Notification key. |
int | KEYCODE_SEARCH Key code constant: Search key. |
int | KEYCODE_MEDIA_PLAY_PAUSE Key code constant: Play/Pause media key. |
int | KEYCODE_MEDIA_STOP Key code constant: Stop media key. |
int | KEYCODE_MEDIA_NEXT Key code constant: Play Next media key. |
int | KEYCODE_MEDIA_PREVIOUS Key code constant: Play Previous media key. |
int | KEYCODE_MEDIA_REWIND Key code constant: Rewind media key. |
int | KEYCODE_MEDIA_FAST_FORWARD Key code constant: Fast Forward media key. |
int | KEYCODE_MUTE Key code constant: Mute key. |
int | KEYCODE_PAGE_UP Key code constant: Page Up key. |
int | KEYCODE_PAGE_DOWN Key code constant: Page Down key. |
int | KEYCODE_PICTSYMBOLS Key code constant: Picture Symbols modifier key. |
int | KEYCODE_SWITCH_CHARSET Key code constant: Switch Charset modifier key. |
int | KEYCODE_BUTTON_A Key code constant: A Button key. |
int | KEYCODE_BUTTON_B Key code constant: B Button key. |
int | KEYCODE_BUTTON_X Key code constant: X Button key. |
int | KEYCODE_BUTTON_Y Key code constant: Y Button key. |
int | KEYCODE_BUTTON_L1 Key code constant: L1 Button key. |
int | KEYCODE_BUTTON_R1 Key code constant: R1 Button key. |
int | KEYCODE_BUTTON_L2 Key code constant: L2 Button key. |
int | KEYCODE_BUTTON_R2 Key code constant: R2 Button key. |
int | KEYCODE_ESCAPE Key code constant: Escape key. |
int | KEYCODE_FORWARD_DEL Key code constant: Forward Delete key. |
int | KEYCODE_CTRL_LEFT Key code constant: Left Control modifier key. |
int | KEYCODE_CTRL_RIGHT Key code constant: Right Control modifier key. |
int | KEYCODE_META_LEFT Key code constant: Left Meta modifier key. |
int | KEYCODE_MOVE_HOME Key code constant: Home Movement key. |
int | KEYCODE_MOVE_END Key code constant: End Movement key. |
int | KEYCODE_MEDIA_PLAY Key code constant: Play media key. |
int | KEYCODE_MEDIA_PAUSE Key code constant: Pause media key. |
int | KEYCODE_MEDIA_RECORD Key code constant: Record media key. |
int | KEYCODE_F5 Key code constant: F5 key. |
int | KEYCODE_NUMPAD_0 Key code constant: Numeric keypad '0' key. |
int | KEYCODE_NUMPAD_1 Key code constant: Numeric keypad '1' key. |
int | KEYCODE_NUMPAD_2 Key code constant: Numeric keypad '2' key. |
int | KEYCODE_NUMPAD_3 Key code constant: Numeric keypad '3' key. |
int | KEYCODE_NUMPAD_4 Key code constant: Numeric keypad '4' key. |
int | KEYCODE_NUMPAD_5 Key code constant: Numeric keypad '5' key. |
int | KEYCODE_NUMPAD_6 Key code constant: Numeric keypad '6' key. |
int | KEYCODE_NUMPAD_7 Key code constant: Numeric keypad '7' key. |
int | KEYCODE_NUMPAD_8 Key code constant: Numeric keypad '8' key. |
int | KEYCODE_NUMPAD_9 Key code constant: Numeric keypad '9' key. |
int | KEYCODE_NUMPAD_DOT Key code constant: Numeric keypad '.' |
int | KEYCODE_NUMPAD_ENTER Key code constant: Numeric keypad Enter key. |
int | KEYCODE_VOLUME_MUTE Key code constant: Volume Mute key. |
int | KEYCODE_INFO Key code constant: Info key. |
int | KEYCODE_CHANNEL_UP Key code constant: Channel up key. |
int | KEYCODE_CHANNEL_DOWN Key code constant: Channel down key. |
int | KEYCODE_ZOOM_IN Key code constant: Zoom in key. |
int | KEYCODE_ZOOM_OUT Key code constant: Zoom out key. |
int | KEYCODE_GUIDE Key code constant: Guide key. |
int | KEYCODE_BOOKMARK Key code constant: Bookmark key. |
int | KEYCODE_CAPTIONS Key code constant: Toggle captions key. |
int | KEYCODE_TV_INPUT Key code constant: TV input key. |
int | KEYCODE_PROG_RED Key code constant: Red "programmable" key. |
int | KEYCODE_PROG_GREEN Key code constant: Green "programmable" key. |
int | KEYCODE_PROG_YELLOW Key code constant: Yellow "programmable" key. |
int | KEYCODE_PROG_BLUE Key code constant: Blue "programmable" key. |
int | KEYCODE_3D_MODE Key code constant: 3D Mode key. |
int | KEYCODE_MUSIC Key code constant: Music special function key. |
int | KEYCODE_MEDIA_AUDIO_TRACK Key code constant: Audio Track key. |
int | KEYCODE_PAIRING Key code constant: Pairing key. |
int | KEYCODE_VOICE_ASSIST Key code constant: Voice Assist key. |
int | ACTION_DOWN #getAction value: the key has been pressed down. |
int | ACTION_UP #getAction value: the key has been released. |
int | ACTION_MULTIPLE #getAction value: multiple duplicate key events have occurred in a row, or a complex string is being delivered. |
int | META_ALT_ON This mask is used to check whether one of the ALT meta keys is pressed. |
int | META_ALT_LEFT_ON This mask is used to check whether the left ALT meta key is pressed. |
int | META_SHIFT_ON This mask is used to check whether one of the SHIFT meta keys is pressed. |
int | META_SHIFT_LEFT_ON This mask is used to check whether the left SHIFT meta key is pressed. |
int | META_SYM_ON This mask is used to check whether the SYM meta key is pressed. |
int | META_FUNCTION_ON This mask is used to check whether the FUNCTION meta key is pressed. |
int | META_CTRL_ON This mask is used to check whether one of the CTRL meta keys is pressed. |
int | META_CTRL_LEFT_ON This mask is used to check whether the left CTRL meta key is pressed. |
int | META_META_ON This mask is used to check whether one of the META meta keys is pressed. |
int | META_META_LEFT_ON This mask is used to check whether the left META meta key is pressed. |
int | META_ALT_MASK This mask is a combination of #META_ALT_ON , #META_ALT_LEFT_ON and #META_ALT_RIGHT_ON . |
int | META_CTRL_MASK This mask is a combination of #META_CTRL_ON , #META_CTRL_LEFT_ON and #META_CTRL_RIGHT_ON . |
int | META_META_MASK This mask is a combination of #META_META_ON , #META_META_LEFT_ON and #META_META_RIGHT_ON . |
int | FLAG_SOFT_KEYBOARD This mask is set if the key event was generated by a software keyboard. |
int | FLAG_KEEP_TOUCH_MODE This mask is set if we don't want the key event to cause us to leave touch mode. |
int | FLAG_FROM_SYSTEM This mask is set if an event was known to come from a trusted part of the system. |
int | FLAG_LONG_PRESS This flag is set for the first key repeat that occurs after the long press timeout. |
int | FLAG_CANCELED_LONG_PRESS Set when a key event has #FLAG_CANCELED set because a long press action was executed while it was down. |
KeyEvent(int action, int code) Create a new key event. | |
KeyEvent(KeyEvent origEvent, int action) Copy an existing key event, modifying its action. | |
KeyEvent(long time, String characters, int deviceId, int flags) Create a new key event for a string of characters. | |
KeyEvent(long downTime, long eventTime, int action, int code, int repeat, int metaState, int deviceId, int scancode, int flags) 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) Create a new key event. | |
KeyEvent(KeyEvent origEvent) Make an exact copy of an existing key event. | |
KeyEvent(Parcel in) | |
KeyEvent(long downTime, long eventTime, int action, int code, int repeat, int metaState, int deviceId, int scancode) Create a new key event. |
KeyEvent | changeTimeRepeat(KeyEvent event, long eventTime, int newRepeat) Create a new key event that is the same as the given one, but whose event time and repeat count are replaced with the given value. |
boolean | dispatch(Callback receiver, DispatcherState state, Object target) Deliver this key event to a Callback interface. |
boolean | dispatch(Callback receiver) |
int | getAction() Retrieve the action of this key event. |
String | getCharacters() For the special case of a #ACTION_MULTIPLE event with key code of #KEYCODE_UNKNOWN , this is a raw string of characters associated with the event. |
int | getDeadChar(int accent, int c) Get the character that is produced by putting accent on the character c. |
InputDevice | getDevice() Gets the device that this event came from. |
int | getDeviceId() |
char | getDisplayLabel() Gets the primary character for this key. |
long | getDownTime() Retrieve the time of the most recent key down event, in the android.os.SystemClock#uptimeMillis time base. |
long | getEventTime() Retrieve the time this event occurred, in the android.os.SystemClock#uptimeMillis time base. |
int | getFlags() Returns the flags for this key event. |
int | getKeyCode() Retrieve the key code of the key event. |
boolean | getKeyData(KeyData results) Get the character conversion data for a given key code. |
char | getMatch(char[] chars) Gets the first character in the character array that can be generated by the specified key code. |
int | getMetaState() Returns the state of the meta keys. |
int | getModifiers() Returns the state of the modifier keys. |
char | getNumber() Gets the number or symbol associated with the key. |
int | getRepeatCount() Retrieve the repeat count of the event. |
int | getScanCode() Retrieve the hardware key id of this key event. |
int | getSource() |
int | getUnicodeChar() Gets the Unicode character generated by the specified key and meta key state combination. |
int | getUnicodeChar(int metaState) Gets the Unicode character generated by the specified key and meta key state combination. |
boolean | hasModifiers(int modifiers) Returns true if only the specified modifiers keys are pressed. |
boolean | hasNoModifiers() Returns true if no modifier keys are pressed. |
boolean | isAltPressed() Returns the pressed state of the ALT meta key. |
boolean | isCanceled() For #ACTION_UP events, indicates that the event has been canceled as per #FLAG_CANCELED . |
boolean | isCtrlPressed() Returns the pressed state of the CTRL meta key. |
boolean | isFromSource(int source) Determines whether the event is from the given source. |
boolean | isGamepadButton(int keyCode) Returns true if the specified keycode is a gamepad button. |
boolean | isLongPress() For #ACTION_DOWN events, indicates that the event has been canceled as per #FLAG_LONG_PRESS . |
boolean | isModifierKey(int keyCode) Returns true if this key code is a modifier key. |
boolean | isNumLockOn() Returns the locked state of the NUM LOCK meta key. |
boolean | isPrintingKey() Returns true if this key produces a glyph. |
boolean | isShiftPressed() Returns the pressed state of the SHIFT meta key. |
boolean | isSystem() Is this a system key? |
boolean | isTracking() For #ACTION_UP events, indicates that the event is still being tracked from its initial down event as per #FLAG_TRACKING . |
String | keyCodeToString(int keyCode) Returns a string that represents the symbolic name of the specified keycode such as "KEYCODE_A", "KEYCODE_DPAD_UP", or an equivalent numeric constant such as "1001" if unknown. |
boolean | metaStateHasModifiers(int metaState, int modifiers) Returns true if only the specified modifier keys are pressed according to the specified meta state. |
boolean | metaStateHasNoModifiers(int metaState) Returns true if no modifiers keys are pressed according to the specified meta state. |
void | startTracking() Call this during Callback#onKeyDown to have the system track the key through its final up (possibly including a long press). |
String | toString() |