Professional Documents
Culture Documents
Evento clave
Kotlin | Java
public class KeyEvent
extends InputEvent implements Parcelable
java.lang.Object
↳ android.view.InputEvent
↳ android.view.KeyEvent
Los códigos de las teclas suelen corresponder de una a una con teclas
individuales en un dispositivo de entrada. Muchas teclas y combinaciones de
teclas tienen funciones muy diferentes en diferentes dispositivos de entrada,
por lo que se debe tener cuidado al interpretarlas. Utilice siempre
el KeyCharacterMapasociado con el dispositivo de entrada cuando asigne
claves a caracteres. Tenga en cuenta que puede haber varios dispositivos de
entrada clave activos al mismo tiempo y cada uno tendrá su propio mapa de
caracteres clave.
Como los métodos de entrada suave pueden usar formas múltiples e inventivas
de ingresar texto, no hay garantía de que cualquier pulsación de tecla en un
teclado suave genere un evento clave: esto se deja a la discreción del IME, y
de hecho se desaconseja el envío de tales eventos. Nunca debe confiar en
recibir eventos clave para cualquier clave en un método de entrada suave. En
particular, el teclado de software predeterminado nunca enviará ningún evento
clave a ninguna aplicación dirigida a Jelly Bean o posterior, y solo enviará
eventos para algunas pulsaciones de las teclas eliminar y devolver a las
aplicaciones que tengan como objetivo Ice Cream Sandwich o versiones
anteriores. Tenga en cuenta que es posible que otros métodos de entrada de
software nunca envíen eventos clave independientemente de la
versión. Considera usar acciones de editor
comoEditorInfo.IME_ACTION_DONE Si necesita una interacción específica
con el teclado del software, ya que le da más visibilidad al usuario sobre cómo
reaccionará su aplicación a las pulsaciones de teclas.
Al interactuar con un IME, el marco puede entregar eventos clave con la acción
especial ACTION_MULTIPLEque especifica ese único código de tecla repetida o
una secuencia de caracteres para insertar.
En general, el marco no puede garantizar que los eventos clave que entrega a
una vista siempre constituyan secuencias de teclas completas, ya que algunos
eventos pueden eliminarse o modificarse al contener vistas antes de
entregarse. La implementación de la vista debe estar preparada para
manejar FLAG_CANCELEDy debe tolerar situaciones anómalas, como recibir una
nueva ACTION_DOWNsin haber recibido ACTION_UPpreviamente una pulsación
de tecla anterior.
Resumen
Clases anidadas
interface KeyEvent.Callback
class KeyEvent.DispatcherState
Constantes
int ACTION_DOWN
int ACTION_MULTIPLE
Esta constante quedó en desuso en el nivel de API 29. Ya no se usa en el sistema de
entrada. getAction()valor: se han producido varios eventos de clave duplicada en una fila o
entregando una cadena compleja. Si el código clave no lo es KEYCODE_UNKNOWN,
el getRepeatCount()método devuelve el número de veces que se debe ejecutar el código c
lo contrario, si el código clave es KEYCODE_UNKNOWN, entonces esta es una secuencia de car
como la devuelve getCharacters().
int ACTION_UP
int FLAG_CANCELED
Cuando se asocia con eventos de tecla arriba, esto indica que la pulsación de tecla se ha can
int FLAG_CANCELED_LONG_PRESS
int FLAG_EDITOR_ACTION
Esta máscara se usa para la compatibilidad, para identificar las claves de ingreso que provien
cuya clave de ingreso se ha etiquetado automáticamente como "siguiente" o "hecho".
int FLAG_FALLBACK
int FLAG_FROM_SYSTEM
Esta máscara se establece si se sabe que un evento proviene de una parte confiable del siste
int FLAG_KEEP_TOUCH_MODE
Esta máscara se establece si no queremos que el evento clave haga que salgamos del modo
int FLAG_LONG_PRESS
Este indicador se establece para la primera repetición de la tecla que se produce después del
espera prolongado de la pulsación.
int FLAG_SOFT_KEYBOARD
Esta máscara se establece si el evento clave fue generado por un teclado de software.
int FLAG_TRACKING
Establecido para ACTION_UPcuando el código clave de este evento todavía se está rastreand
inicial hacia abajo.
int FLAG_VIRTUAL_HARD_KEY
Este evento de clave fue generado por un área de clave virtual (en pantalla).
int FLAG_WOKE_HERE
Esta constante quedó en desuso en el nivel API 20. Este indicador nunca será establecido por
que el sistema consume todas las claves de activación.
int KEYCODE_0
int KEYCODE_1
int KEYCODE_11
int KEYCODE_12
int KEYCODE_2
int KEYCODE_3
int KEYCODE_3D_MODE
int KEYCODE_4
int KEYCODE_5
int KEYCODE_6
Clave de código constante: tecla '6'.
int KEYCODE_7
int KEYCODE_8
int KEYCODE_9
int KEYCODE_A
int KEYCODE_ALL_APPS
int KEYCODE_ALT_LEFT
int KEYCODE_ALT_RIGHT
int KEYCODE_APOSTROPHE
int KEYCODE_APP_SWITCH
int KEYCODE_ASSIST
int KEYCODE_AT
int KEYCODE_AVR_INPUT
int KEYCODE_B
int KEYCODE_BACK
int KEYCODE_BACKSLASH
int KEYCODE_BOOKMARK
int KEYCODE_BREAK
int KEYCODE_BRIGHTNESS_DOWN
int KEYCODE_BRIGHTNESS_UP
int KEYCODE_BUTTON_1
int KEYCODE_BUTTON_10
int KEYCODE_BUTTON_11
int KEYCODE_BUTTON_12
int KEYCODE_BUTTON_13
int KEYCODE_BUTTON_15
int KEYCODE_BUTTON_16
int KEYCODE_BUTTON_2
int KEYCODE_BUTTON_3
int KEYCODE_BUTTON_4
int KEYCODE_BUTTON_5
int KEYCODE_BUTTON_6
int KEYCODE_BUTTON_7
int KEYCODE_BUTTON_8
int KEYCODE_BUTTON_9
int KEYCODE_BUTTON_A
int KEYCODE_BUTTON_B
int KEYCODE_BUTTON_L1
int KEYCODE_BUTTON_L2
int KEYCODE_BUTTON_MODE
int KEYCODE_BUTTON_R1
int KEYCODE_BUTTON_R2
int KEYCODE_BUTTON_SELECT
int KEYCODE_BUTTON_START
int KEYCODE_BUTTON_THUMBL
int KEYCODE_BUTTON_THUMBR
int KEYCODE_BUTTON_X
int KEYCODE_BUTTON_Y
int KEYCODE_BUTTON_Z
int KEYCODE_CALCULATOR
int KEYCODE_CALENDAR
int KEYCODE_CALL
int KEYCODE_CAMERA
int KEYCODE_CAPS_LOCK
int KEYCODE_CAPTIONS
int KEYCODE_CHANNEL_DOWN
int KEYCODE_CHANNEL_UP
int KEYCODE_CLEAR
int KEYCODE_COMMA
int KEYCODE_CONTACTS
int KEYCODE_COPY
int KEYCODE_CTRL_RIGHT
int KEYCODE_CUT
int KEYCODE_D
int KEYCODE_DEL
int KEYCODE_DPAD_CENTER
int KEYCODE_DPAD_DOWN
int KEYCODE_DPAD_DOWN_LEFT
int KEYCODE_DPAD_DOWN_RIGHT
int KEYCODE_DPAD_LEFT
int KEYCODE_DPAD_RIGHT
int KEYCODE_DPAD_UP
int KEYCODE_DPAD_UP_LEFT
int KEYCODE_DVR
int KEYCODE_E
int KEYCODE_EISU
int KEYCODE_ENDCALL
int KEYCODE_ENTER
int KEYCODE_ENVELOPE
int KEYCODE_EQUALS
int KEYCODE_ESCAPE
int KEYCODE_EXPLORER
int KEYCODE_F
int KEYCODE_F1
int KEYCODE_F10
int KEYCODE_F12
int KEYCODE_F2
int KEYCODE_F3
int KEYCODE_F4
int KEYCODE_F5
int KEYCODE_F6
int KEYCODE_F7
int KEYCODE_F8
int KEYCODE_F9
int KEYCODE_FOCUS
int KEYCODE_FORWARD
int KEYCODE_FORWARD_DEL
int KEYCODE_G
int KEYCODE_GRAVE
int KEYCODE_GUIDE
int KEYCODE_H
int KEYCODE_HEADSETHOOK
int KEYCODE_HELP
int KEYCODE_HENKAN
int KEYCODE_HOME
int KEYCODE_I
int KEYCODE_INFO
int KEYCODE_INSERT
int KEYCODE_J
int KEYCODE_KANA
int KEYCODE_KATAKANA_HIRAGANA
int KEYCODE_L
int KEYCODE_LANGUAGE_SWITCH
int KEYCODE_LAST_CHANNEL
int KEYCODE_LEFT_BRACKET
int KEYCODE_M
int KEYCODE_MANNER_MODE
int KEYCODE_MEDIA_AUDIO_TRACK
int KEYCODE_MEDIA_CLOSE
int KEYCODE_MEDIA_EJECT
int KEYCODE_MEDIA_FAST_FORWARD
int KEYCODE_MEDIA_PAUSE
int KEYCODE_MEDIA_PLAY
int KEYCODE_MEDIA_PLAY_PAUSE
int KEYCODE_MEDIA_PREVIOUS
int KEYCODE_MEDIA_RECORD
int KEYCODE_MEDIA_REWIND
int KEYCODE_MEDIA_SKIP_BACKWARD
int KEYCODE_MEDIA_SKIP_FORWARD
int KEYCODE_MEDIA_STEP_BACKWARD
int KEYCODE_MEDIA_STEP_FORWARD
int KEYCODE_MEDIA_STOP
int KEYCODE_MEDIA_TOP_MENU
int KEYCODE_META_LEFT
int KEYCODE_META_RIGHT
int KEYCODE_MINUS
int KEYCODE_MOVE_END
int KEYCODE_MOVE_HOME
int KEYCODE_MUHENKAN
int KEYCODE_MUSIC
int KEYCODE_MUTE
int KEYCODE_N
int KEYCODE_NAVIGATE_IN
int KEYCODE_NAVIGATE_NEXT
int KEYCODE_NAVIGATE_OUT
int KEYCODE_NOTIFICATION
int KEYCODE_NUM
int KEYCODE_NUMPAD_0
int KEYCODE_NUMPAD_1
int KEYCODE_NUMPAD_2
int KEYCODE_NUMPAD_3
int KEYCODE_NUMPAD_4
int KEYCODE_NUMPAD_5
int KEYCODE_NUMPAD_6
int KEYCODE_NUMPAD_7
int KEYCODE_NUMPAD_8
int KEYCODE_NUMPAD_9
int KEYCODE_NUMPAD_COMMA
Constante del código clave: Teclado numérico ',' tecla (para decimales o agrupación de dígitos
int KEYCODE_NUMPAD_DIVIDE
int KEYCODE_NUMPAD_DOT
Clave de código constante: Teclado numérico '.' Tecla (para decimales o agrupación de dígito
int KEYCODE_NUMPAD_ENTER
int KEYCODE_NUMPAD_EQUALS
int KEYCODE_NUMPAD_LEFT_PAREN
int KEYCODE_NUMPAD_MULTIPLY
int KEYCODE_NUMPAD_RIGHT_PAREN
int KEYCODE_NUMPAD_SUBTRACT
int KEYCODE_NUM_LOCK
int KEYCODE_O
int KEYCODE_P
int KEYCODE_PAGE_UP
int KEYCODE_PAIRING
int KEYCODE_PASTE
int KEYCODE_PERIOD
int KEYCODE_PICTSYMBOLS
int KEYCODE_PLUS
int KEYCODE_POUND
int KEYCODE_POWER
int KEYCODE_PROFILE_SWITCH
Key code constant: Used to switch current Account that is consuming content.
int KEYCODE_PROG_BLUE
int KEYCODE_PROG_GREEN
int KEYCODE_PROG_RED
int KEYCODE_Q
int KEYCODE_R
int KEYCODE_REFRESH
int KEYCODE_RIGHT_BRACKET
int KEYCODE_RO
int KEYCODE_S
int KEYCODE_SCROLL_LOCK
int KEYCODE_SEARCH
int KEYCODE_SEMICOLON
int KEYCODE_SETTINGS
int KEYCODE_SHIFT_LEFT
int KEYCODE_SHIFT_RIGHT
int KEYCODE_SLEEP
int KEYCODE_SOFT_LEFT
int KEYCODE_SOFT_RIGHT
int KEYCODE_SOFT_SLEEP
int KEYCODE_SPACE
int KEYCODE_STAR
int KEYCODE_STB_INPUT
int KEYCODE_STB_POWER
int KEYCODE_STEM_1
int KEYCODE_STEM_2
int KEYCODE_STEM_3
int KEYCODE_STEM_PRIMARY
Key code constant: Primary stem key for Wear Main power/reset button on watch.
int KEYCODE_SWITCH_CHARSET
int KEYCODE_SYM
int KEYCODE_SYSRQ
int KEYCODE_SYSTEM_NAVIGATION_DOWN
int KEYCODE_SYSTEM_NAVIGATION_LEFT
int KEYCODE_SYSTEM_NAVIGATION_RIGHT
int KEYCODE_SYSTEM_NAVIGATION_UP
int KEYCODE_T
int KEYCODE_TAB
int KEYCODE_THUMBS_DOWN
int KEYCODE_THUMBS_UP
int KEYCODE_TV
int KEYCODE_TV_ANTENNA_CABLE
int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN
int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP
int KEYCODE_TV_CONTENTS_MENU
int KEYCODE_TV_DATA_SERVICE
int KEYCODE_TV_INPUT
int KEYCODE_TV_INPUT_COMPONENT_1
int KEYCODE_TV_INPUT_COMPONENT_2
int KEYCODE_TV_INPUT_COMPOSITE_1
int KEYCODE_TV_INPUT_COMPOSITE_2
int KEYCODE_TV_INPUT_HDMI_1
int KEYCODE_TV_INPUT_HDMI_2
int KEYCODE_TV_INPUT_HDMI_3
int KEYCODE_TV_INPUT_VGA_1
int KEYCODE_TV_MEDIA_CONTEXT_MENU
int KEYCODE_TV_NETWORK
int KEYCODE_TV_NUMBER_ENTRY
int KEYCODE_TV_POWER
int KEYCODE_TV_RADIO_SERVICE
int KEYCODE_TV_SATELLITE
int KEYCODE_TV_SATELLITE_BS
int KEYCODE_TV_SATELLITE_CS
int KEYCODE_TV_SATELLITE_SERVICE
int KEYCODE_TV_TELETEXT
int KEYCODE_TV_TERRESTRIAL_ANALOG
int KEYCODE_TV_TIMER_PROGRAMMING
int KEYCODE_TV_ZOOM_MODE
int KEYCODE_U
int KEYCODE_UNKNOWN
int KEYCODE_V
int KEYCODE_VOICE_ASSIST
int KEYCODE_VOLUME_DOWN
int KEYCODE_VOLUME_MUTE
int KEYCODE_VOLUME_UP
int KEYCODE_W
int KEYCODE_WAKEUP
int KEYCODE_WINDOW
int KEYCODE_Y
int KEYCODE_YEN
int KEYCODE_Z
int KEYCODE_ZENKAKU_HANKAKU
int KEYCODE_ZOOM_IN
int KEYCODE_ZOOM_OUT
int MAX_KEYCODE
This constant was deprecated in API level 15. There are now more than MAX_KEYCODE key
Use getMaxKeyCode() instead.
int META_ALT_LEFT_ON
This mask is used to check whether the left ALT meta key is pressed.
int META_ALT_MASK
int META_ALT_ON
This mask is used to check whether one of the ALT meta keys is pressed.
int META_ALT_RIGHT_ON
This mask is used to check whether the right the ALT meta key is pressed.
int META_CAPS_LOCK_ON
This mask is used to check whether the CAPS LOCK meta key is on.
int META_CTRL_LEFT_ON
This mask is used to check whether the left CTRL meta key is pressed.
int META_CTRL_MASK
int META_CTRL_ON
This mask is used to check whether one of the CTRL meta keys is pressed.
int META_CTRL_RIGHT_ON
This mask is used to check whether the right CTRL meta key is pressed.
int META_FUNCTION_ON
This mask is used to check whether the FUNCTION meta key is pressed.
int META_META_LEFT_ON
This mask is used to check whether the left META meta key is pressed.
int META_META_MASK
int META_META_ON
This mask is used to check whether one of the META meta keys is pressed.
int META_META_RIGHT_ON
This mask is used to check whether the right META meta key is pressed.
int META_NUM_LOCK_ON
This mask is used to check whether the NUM LOCK meta key is on.
int META_SCROLL_LOCK_ON
This mask is used to check whether the SCROLL LOCK meta key is on.
int META_SHIFT_LEFT_ON
This mask is used to check whether the left SHIFT meta key is pressed.
int META_SHIFT_MASK
int META_SHIFT_ON
This mask is used to check whether one of the SHIFT meta keys is pressed.
int META_SHIFT_RIGHT_ON
This mask is used to check whether the right SHIFT meta key is pressed.
int META_SYM_ON
This mask is used to check whether the SYM meta key is pressed.
Inherited constants
Fields
Inherited fields
Public constructors
KeyEvent(long downTime, long eventTime, int action, int code, int repeat)
KeyEvent(long downTime, long eventTime, int action, int code, int repeat, int me
KeyEvent(long downTime, long eventTime, int action, int code, int repeat, int me
deviceId, int scancode)
Create a new key event.
KeyEvent(long downTime, long eventTime, int action, int code, int repeat, int me
deviceId, int scancode, int flags)
KeyEvent(long downTime, long eventTime, int action, int code, int repeat, int me
deviceId, int scancode, int flags, int source)
KeyEvent(KeyEvent origEvent)
Public methods
Create a new key event that is the same as the given one, but w
Create a new key event that is the same as the given one, but w
Create a new key event that is the same as the given one, but w
with the given value.
Create a new key event that is the same as the given one, but w
with the given value.
Gets the id for the device that this event came from.
char getDisplayLabel()
Retrieve the time of the most recent key down event, in the Sys
Gets the first character in the character array that can be genera
Gets a mask that includes all valid modifier key meta state bits.
char getNumber()
Retrieve the hardware key id of this key event. These values are
int getUnicodeChar()
For ACTION_UP events, indicates that the event has been cance
boolean isPrintingKey()
Is this a system key? System keys can not be used for menu sh
For ACTION_UP events, indicates that the event is still being tra
per FLAG_TRACKING.
Returns true if only the specified modifier keys are pressed acco
String toString()
Inherited methods
Constants
ACTION_DOWN
Added in API level 1
ACTION_MULTIPLE
Added in API level 1
Deprecated in API level 29
ACTION_UP
Added in API level 1
FLAG_CANCELED
Added in API level 5
When associated with up key events, this indicates that the key press has been
canceled. Typically this is used with virtual touch screen keys, where the user
can slide from the virtual key area on to the display: in that case, the application
will receive a canceled up event and should not perform the action normally
associated with the key. Note that for this to work, the application can not
perform an action for a key until it receives an up or the long press timeout has
expired.
FLAG_CANCELED_LONG_PRESS
Added in API level 5
Set when a key event has FLAG_CANCELED set because a long press action was
executed while it was down.
FLAG_EDITOR_ACTION
Added in API level 3
This mask is used for compatibility, to identify enter keys that are coming from
an IME whose enter key has been auto-labelled "next" or "done". This allows
TextView to dispatch these as normal enter keys for old applications, but still do
the appropriate action when receiving them.
FLAG_FALLBACK
Added in API level 11
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).
FLAG_FROM_SYSTEM
Added in API level 3
This mask is set if an event was known to come from a trusted part of the
system. That is, the event is known to come from the user, and could not have
been spoofed by a third party component.
FLAG_KEEP_TOUCH_MODE
Added in API level 3
This mask is set if we don't want the key event to cause us to leave touch
mode.
FLAG_LONG_PRESS
Added in API level 5
This flag is set for the first key repeat that occurs after the long press timeout.
FLAG_SOFT_KEYBOARD
Added in API level 3
This mask is set if the key event was generated by a software keyboard.
FLAG_TRACKING
Added in API level 5
Set for ACTION_UP when this event's key code is still being tracked from its
initial down. That is, somebody requested that tracking started on the key down
and a long press has not caused the tracking to be canceled.
FLAG_VIRTUAL_HARD_KEY
Added in API level 5
This key event was generated by a virtual (on-screen) hard key area. Typically
this is an area of the touchscreen, outside of the regular display, dedicated to
"hardware" buttons.
FLAG_WOKE_HERE
Added in API level 1
Deprecated in API level 20
This mask is set if the device woke because of this key event.
KEYCODE_0
Added in API level 1
KEYCODE_1
Added in API level 1
KEYCODE_11
Added in API level 21
KEYCODE_12
Added in API level 21
KEYCODE_2
Added in API level 1
KEYCODE_3D_MODE
public static final int KEYCODE_3D_MODE
Key code constant: 3D Mode key. Toggles the display between 2D and 3D
mode. * @apiSince 14
KEYCODE_4
Added in API level 1
KEYCODE_5
Added in API level 1
KEYCODE_6
Added in API level 1
KEYCODE_7
Added in API level 1
KEYCODE_8
Added in API level 1
KEYCODE_9
Added in API level 1
KEYCODE_A
Added in API level 1
KEYCODE_ALL_APPS
Added in API level 28
public static final int KEYCODE_ALL_APPS
KEYCODE_ALT_LEFT
Added in API level 1
KEYCODE_ALT_RIGHT
Added in API level 1
KEYCODE_APOSTROPHE
Added in API level 1
KEYCODE_APP_SWITCH
public static final int KEYCODE_APP_SWITCH
Key code constant: App switch key. Should bring up the application switcher
dialog. * @apiSince 11
Key code constant: Assist key. Launches the global assist activity. Not delivered
to applications. * @apiSince 16
KEYCODE_AT
Added in API level 1
KEYCODE_AVR_INPUT
public static final int KEYCODE_AVR_INPUT
Key code constant: A/V Receiver input key. On TV remotes, switches the input
mode on an external A/V Receiver. * @apiSince 11
KEYCODE_AVR_POWER
public static final int KEYCODE_AVR_POWER
Key code constant: A/V Receiver power key. On TV remotes, toggles the power
on an external A/V Receiver. * @apiSince 11
KEYCODE_B
Added in API level 1
KEYCODE_BACKSLASH
Added in API level 1
KEYCODE_BOOKMARK
public static final int KEYCODE_BOOKMARK
KEYCODE_BREAK
Added in API level 11
KEYCODE_BRIGHTNESS_DOWN
public static final int KEYCODE_BRIGHTNESS_DOWN
Key code constant: Brightness Down key. Adjusts the screen brightness down.
* @apiSince 18
Constant Value: 220 (0x000000dc)
KEYCODE_BRIGHTNESS_UP
public static final int KEYCODE_BRIGHTNESS_UP
Key code constant: Brightness Up key. Adjusts the screen brightness up. *
@apiSince 18
KEYCODE_BUTTON_1
Added in API level 12
KEYCODE_BUTTON_10
Added in API level 12
KEYCODE_BUTTON_11
Added in API level 12
KEYCODE_BUTTON_12
Added in API level 12
public static final int KEYCODE_BUTTON_12
KEYCODE_BUTTON_13
Añadido en el nivel API 12
KEYCODE_BUTTON_14
Añadido en el nivel API 12
KEYCODE_BUTTON_15
Añadido en el nivel API 12
KEYCODE_BUTTON_16
Añadido en el nivel API 12
KEYCODE_BUTTON_3
Añadido en el nivel API 12
KEYCODE_BUTTON_4
Añadido en el nivel API 12
KEYCODE_BUTTON_5
Añadido en el nivel API 12
KEYCODE_BUTTON_6
Añadido en el nivel API 12
KEYCODE_BUTTON_7
Added in API level 12
KEYCODE_BUTTON_8
Added in API level 12
KEYCODE_BUTTON_9
Added in API level 12
KEYCODE_BUTTON_A
public static final int KEYCODE_BUTTON_A
Key code constant: A Button key. On a game controller, the A button should be
either the button labeled A or the first button on the bottom row of controller
buttons. * @apiSince 9
KEYCODE_BUTTON_B
public static final int KEYCODE_BUTTON_B
Key code constant: B Button key. On a game controller, the B button should be
either the button labeled B or the second button on the bottom row of controller
buttons. * @apiSince 9
KEYCODE_BUTTON_C
public static final int KEYCODE_BUTTON_C
Key code constant: C Button key. On a game controller, the C button should be
either the button labeled C or the third button on the bottom row of controller
buttons. * @apiSince 9
KEYCODE_BUTTON_L1
public static final int KEYCODE_BUTTON_L1
Key code constant: L1 Button key. On a game controller, the L1 button should
be either the button labeled L1 (or L) or the top left trigger button. * @apiSince 9
KEYCODE_BUTTON_L2
public static final int KEYCODE_BUTTON_L2
Key code constant: L2 Button key. On a game controller, the L2 button should
be either the button labeled L2 or the bottom left trigger button. * @apiSince 9
KEYCODE_BUTTON_MODE
public static final int KEYCODE_BUTTON_MODE
Key code constant: Mode Button key. On a game controller, the button labeled
Mode. * @apiSince 9
Key code constant: R1 Button key. On a game controller, the R1 button should
be either the button labeled R1 (or R) or the top right trigger button. *
@apiSince 9
KEYCODE_BUTTON_R2
public static final int KEYCODE_BUTTON_R2
Key code constant: R2 Button key. On a game controller, the R2 button should
be either the button labeled R2 or the bottom right trigger button. * @apiSince 9
KEYCODE_BUTTON_SELECT
public static final int KEYCODE_BUTTON_SELECT
Key code constant: Select Button key. On a game controller, the button labeled
Select. * @apiSince 9
KEYCODE_BUTTON_START
public static final int KEYCODE_BUTTON_START
Key code constant: Start Button key. On a game controller, the button labeled
Start. * @apiSince 9
KEYCODE_BUTTON_THUMBL
public static final int KEYCODE_BUTTON_THUMBL
Key code constant: Left Thumb Button key. On a game controller, the left thumb
button indicates that the left (or only) joystick is pressed. * @apiSince 9
Key code constant: Right Thumb Button key. On a game controller, the right
thumb button indicates that the right joystick is pressed. * @apiSince 9
KEYCODE_BUTTON_X
public static final int KEYCODE_BUTTON_X
Key code constant: X Button key. On a game controller, the X button should be
either the button labeled X or the first button on the upper row of controller
buttons. * @apiSince 9
KEYCODE_BUTTON_Y
public static final int KEYCODE_BUTTON_Y
Key code constant: Y Button key. On a game controller, the Y button should be
either the button labeled Y or the second button on the upper row of controller
buttons. * @apiSince 9
KEYCODE_BUTTON_Z
public static final int KEYCODE_BUTTON_Z
Key code constant: Z Button key. On a game controller, the Z button should be
either the button labeled Z or the third button on the upper row of controller
buttons. * @apiSince 9
KEYCODE_C
Added in API level 1
KEYCODE_CALCULATOR
public static final int KEYCODE_CALCULATOR
Key code constant: Calculator special function key. Used to launch a calculator
application. * @apiSince 15
KEYCODE_CALENDAR
public static final int KEYCODE_CALENDAR
Key code constant: Calendar special function key. Used to launch a calendar
application. * @apiSince 15
KEYCODE_CALL
Added in API level 1
KEYCODE_CAMERA
public static final int KEYCODE_CAMERA
Key code constant: Camera key. Used to launch a camera application or take
pictures. * @apiSince 1
KEYCODE_CAPS_LOCK
Added in API level 11
public static final int KEYCODE_CAPS_LOCK
KEYCODE_CAPTIONS
public static final int KEYCODE_CAPTIONS
Key code constant: Toggle captions key. Switches the mode for closed-
captioning text, for example during television shows. * @apiSince 11
KEYCODE_CHANNEL_DOWN
public static final int KEYCODE_CHANNEL_DOWN
KEYCODE_CHANNEL_UP
public static final int KEYCODE_CHANNEL_UP
KEYCODE_CLEAR
Added in API level 1
KEYCODE_COMMA
Added in API level 1
KEYCODE_CONTACTS
public static final int KEYCODE_CONTACTS
Key code constant: Contacts special function key. Used to launch an address
book application. * @apiSince 15
KEYCODE_COPY
Added in API level 24
KEYCODE_CTRL_LEFT
Added in API level 11
KEYCODE_CTRL_RIGHT
Added in API level 11
KEYCODE_D
Added in API level 1
KEYCODE_DEL
public static final int KEYCODE_DEL
Key code constant: Backspace key. Deletes characters before the insertion
point, unlike KEYCODE_FORWARD_DEL. * @apiSince 1
KEYCODE_DPAD_CENTER
public static final int KEYCODE_DPAD_CENTER
Key code constant: Directional Pad Center key. May also be synthesized from
trackball motions. * @apiSince 1
KEYCODE_DPAD_DOWN
public static final int KEYCODE_DPAD_DOWN
Key code constant: Directional Pad Down key. May also be synthesized from
trackball motions. * @apiSince 1
KEYCODE_DPAD_DOWN_RIGHT
Added in API level 24
KEYCODE_DPAD_LEFT
public static final int KEYCODE_DPAD_LEFT
Key code constant: Directional Pad Left key. May also be synthesized from
trackball motions. * @apiSince 1
KEYCODE_DPAD_RIGHT
public static final int KEYCODE_DPAD_RIGHT
Key code constant: Directional Pad Right key. May also be synthesized from
trackball motions. * @apiSince 1
KEYCODE_DPAD_UP
public static final int KEYCODE_DPAD_UP
Key code constant: Directional Pad Up key. May also be synthesized from
trackball motions. * @apiSince 1
KEYCODE_DPAD_UP_RIGHT
Added in API level 24
KEYCODE_DVR
public static final int KEYCODE_DVR
Key code constant: DVR key. On some TV remotes, switches to a DVR mode
for recorded shows. * @apiSince 11
KEYCODE_E
Added in API level 1
KEYCODE_EISU
Added in API level 16
KEYCODE_ENDCALL
Added in API level 1
KEYCODE_ENTER
Added in API level 1
KEYCODE_ENVELOPE
public static final int KEYCODE_ENVELOPE
Key code constant: Envelope special function key. Used to launch a mail
application. * @apiSince 1
KEYCODE_EQUALS
Added in API level 1
KEYCODE_ESCAPE
Added in API level 11
public static final int KEYCODE_ESCAPE
KEYCODE_EXPLORER
public static final int KEYCODE_EXPLORER
Key code constant: Explorer special function key. Used to launch a browser
application. * @apiSince 1
KEYCODE_F
Added in API level 1
KEYCODE_F1
Added in API level 11
KEYCODE_F10
Added in API level 11
KEYCODE_F12
Added in API level 11
KEYCODE_F2
Added in API level 11
KEYCODE_F3
Added in API level 11
KEYCODE_F4
Added in API level 11
KEYCODE_F5
Added in API level 11
KEYCODE_F6
Added in API level 11
KEYCODE_F7
Added in API level 11
KEYCODE_F8
Added in API level 11
KEYCODE_F9
Added in API level 11
KEYCODE_FOCUS
public static final int KEYCODE_FOCUS
Key code constant: Camera Focus key. Used to focus the camera. * @apiSince
1
KEYCODE_FORWARD
public static final int KEYCODE_FORWARD
Key code constant: Forward key. Navigates forward in the history stack.
Complement of KEYCODE_BACK. * @apiSince 11
KEYCODE_FORWARD_DEL
public static final int KEYCODE_FORWARD_DEL
Key code constant: Forward Delete key. Deletes characters ahead of the
insertion point, unlike KEYCODE_DEL. * @apiSince 11
KEYCODE_FUNCTION
Added in API level 11
KEYCODE_GRAVE
Added in API level 1
KEYCODE_GUIDE
public static final int KEYCODE_GUIDE
KEYCODE_H
Added in API level 1
KEYCODE_HEADSETHOOK
public static final int KEYCODE_HEADSETHOOK
Key code constant: Headset Hook key. Used to hang up calls and stop media. *
@apiSince 1
Constant Value: 79 (0x0000004f)
KEYCODE_HELP
Added in API level 21
KEYCODE_HENKAN
Added in API level 16
KEYCODE_HOME
public static final int KEYCODE_HOME
Key code constant: Home key. This key is handled by the framework and is
never delivered to applications. * @apiSince 1
KEYCODE_I
Added in API level 1
KEYCODE_INFO
public static final int KEYCODE_INFO
Key code constant: Info key. Common on TV remotes to show additional
information related to what is currently being viewed. * @apiSince 11
KEYCODE_INSERT
public static final int KEYCODE_INSERT
Key code constant: Insert key. Toggles insert / overwrite edit mode. *
@apiSince 11
KEYCODE_J
Added in API level 1
KEYCODE_K
Added in API level 1
KEYCODE_KANA
Added in API level 16
KEYCODE_KATAKANA_HIRAGANA
Añadido en el nivel 16 de API
KEYCODE_L
Añadido en el nivel API 1
KEYCODE_LANGUAGE_SWITCH
public static final int KEYCODE_LANGUAGE_SWITCH
KEYCODE_LAST_CHANNEL
public static final int KEYCODE_LAST_CHANNEL
Clave de código constante: Última clave del canal. Va al último canal visto. *
@apiSince 21
KEYCODE_LEFT_BRACKET
Añadido en el nivel API 1
KEYCODE_MANNER_MODE
public static final int KEYCODE_MANNER_MODE
KEYCODE_MEDIA_AUDIO_TRACK
public static final int KEYCODE_MEDIA_AUDIO_TRACK
KEYCODE_MEDIA_CLOSE
public static final int KEYCODE_MEDIA_CLOSE
Clave de código constante: Cerrar clave de medios. Puede usarse para cerrar
una bandeja de CD, por ejemplo. * @apiSince 11
KEYCODE_MEDIA_EJECT
public static final int KEYCODE_MEDIA_EJECT
Key code constant: Eject media key. May be used to eject a CD tray, for
example. * @apiSince 11
Constant Value: 129 (0x00000081)
KEYCODE_MEDIA_FAST_FORWARD
Added in API level 3
KEYCODE_MEDIA_NEXT
Added in API level 3
KEYCODE_MEDIA_PAUSE
Added in API level 11
KEYCODE_MEDIA_PLAY
Added in API level 11
KEYCODE_MEDIA_PLAY_PAUSE
Added in API level 3
public static final int KEYCODE_MEDIA_PLAY_PAUSE
KEYCODE_MEDIA_PREVIOUS
Added in API level 3
KEYCODE_MEDIA_RECORD
Added in API level 11
KEYCODE_MEDIA_REWIND
Added in API level 3
KEYCODE_MEDIA_SKIP_BACKWARD
Added in API level 23
KEYCODE_MEDIA_STEP_BACKWARD
public static final int KEYCODE_MEDIA_STEP_BACKWARD
Key code constant: Step backward media key. Steps media backward, one
frame at a time. * @apiSince 23
KEYCODE_MEDIA_STEP_FORWARD
public static final int KEYCODE_MEDIA_STEP_FORWARD
Key code constant: Step forward media key. Steps media forward, one frame at
a time. * @apiSince 23
KEYCODE_MEDIA_STOP
Added in API level 3
KEYCODE_MEDIA_TOP_MENU
public static final int KEYCODE_MEDIA_TOP_MENU
Key code constant: Media Top Menu key. Goes to the top of media menu. *
@apiSince 21
KEYCODE_META_LEFT
Added in API level 11
KEYCODE_META_RIGHT
Added in API level 11
KEYCODE_MINUS
Added in API level 1
KEYCODE_MOVE_END
public static final int KEYCODE_MOVE_END
Key code constant: End Movement key. Used for scrolling or moving the cursor
around to the end of a line or to the bottom of a list. * @apiSince 11
Constant Value: 123 (0x0000007b)
KEYCODE_MOVE_HOME
public static final int KEYCODE_MOVE_HOME
Key code constant: Home Movement key. Used for scrolling or moving the
cursor around to the start of a line or to the top of a list. * @apiSince 11
KEYCODE_MUHENKAN
Added in API level 16
KEYCODE_MUSIC
public static final int KEYCODE_MUSIC
Key code constant: Music special function key. Used to launch a music player
application. * @apiSince 15
KEYCODE_MUTE
public static final int KEYCODE_MUTE
KEYCODE_N
Added in API level 1
KEYCODE_NAVIGATE_IN
public static final int KEYCODE_NAVIGATE_IN
Key code constant: Navigate in key. Activates the item that currently has focus
or expands to the next level of a navigation hierarchy. * @apiSince 23
KEYCODE_NAVIGATE_NEXT
public static final int KEYCODE_NAVIGATE_NEXT
Key code constant: Navigate to next key. Advances to the next item in an
ordered collection of items. * @apiSince 23
KEYCODE_NAVIGATE_OUT
public static final int KEYCODE_NAVIGATE_OUT
Key code constant: Navigate out key. Backs out one level of a navigation
hierarchy or collapses the item that currently has focus. * @apiSince 23
KEYCODE_NAVIGATE_PREVIOUS
public static final int KEYCODE_NAVIGATE_PREVIOUS
Key code constant: Navigate to previous key. Goes backward by one item in an
ordered collection of items. * @apiSince 23
KEYCODE_NOTIFICATION
Added in API level 1
KEYCODE_NUM
public static final int KEYCODE_NUM
Key code constant: Number modifier key. Used to enter numeric symbols. This
key is not Num Lock; it is more like KEYCODE_ALT_LEFT and is interpreted as an
ALT key by MetaKeyKeyListener. * @apiSince 1
KEYCODE_NUMPAD_0
Added in API level 11
KEYCODE_NUMPAD_1
Added in API level 11
KEYCODE_NUMPAD_2
Added in API level 11
KEYCODE_NUMPAD_3
Added in API level 11
KEYCODE_NUMPAD_4
Added in API level 11
KEYCODE_NUMPAD_5
Added in API level 11
KEYCODE_NUMPAD_6
Added in API level 11
KEYCODE_NUMPAD_7
Added in API level 11
KEYCODE_NUMPAD_9
Added in API level 11
KEYCODE_NUMPAD_ADD
Added in API level 11
KEYCODE_NUMPAD_COMMA
Added in API level 11
Key code constant: Numeric keypad ',' key (for decimals or digit grouping).
KEYCODE_NUMPAD_DIVIDE
Added in API level 11
KEYCODE_NUMPAD_DOT
Added in API level 11
Key code constant: Numeric keypad '.' key (for decimals or digit grouping).
KEYCODE_NUMPAD_ENTER
Added in API level 11
KEYCODE_NUMPAD_EQUALS
Added in API level 11
KEYCODE_NUMPAD_LEFT_PAREN
Added in API level 11
KEYCODE_NUMPAD_MULTIPLY
Added in API level 11
KEYCODE_NUMPAD_RIGHT_PAREN
Added in API level 11
KEYCODE_NUMPAD_SUBTRACT
Added in API level 11
KEYCODE_NUM_LOCK
public static final int KEYCODE_NUM_LOCK
Key code constant: Num Lock key. This is the Num Lock key; it is different
from KEYCODE_NUM. This key alters the behavior of other keys on the numeric
keypad. * @apiSince 11
KEYCODE_O
Added in API level 1
KEYCODE_PAGE_DOWN
Added in API level 9
KEYCODE_PAGE_UP
Added in API level 9
KEYCODE_PAIRING
public static final int KEYCODE_PAIRING
Key code constant: Pairing key. Initiates peripheral pairing mode. Useful for
pairing remote control devices or game controllers, especially if no other input
mode is available. * @apiSince 21
KEYCODE_PASTE
Added in API level 24
KEYCODE_PERIOD
Added in API level 1
KEYCODE_PICTSYMBOLS
public static final int KEYCODE_PICTSYMBOLS
Key code constant: Picture Symbols modifier key. Used to switch symbol sets
(Emoji, Kao-moji). * @apiSince 9
KEYCODE_PLUS
Added in API level 1
KEYCODE_POUND
Added in API level 1
KEYCODE_POWER
Added in API level 1
KEYCODE_PROFILE_SWITCH
Added in API level 29
Key code constant: Used to switch current Account that is consuming content.
May be consumed by system to set account globally.
KEYCODE_PROG_BLUE
public static final int KEYCODE_PROG_BLUE
KEYCODE_PROG_GREEN
public static final int KEYCODE_PROG_GREEN
KEYCODE_PROG_RED
public static final int KEYCODE_PROG_RED
KEYCODE_Q
Added in API level 1
KEYCODE_R
Added in API level 1
KEYCODE_REFRESH
Added in API level 28
KEYCODE_RIGHT_BRACKET
Added in API level 1
KEYCODE_RO
Added in API level 16
KEYCODE_S
Added in API level 1
KEYCODE_SCROLL_LOCK
Added in API level 11
KEYCODE_SEARCH
Added in API level 1
KEYCODE_SEMICOLON
Added in API level 1
public static final int KEYCODE_SEMICOLON
KEYCODE_SETTINGS
public static final int KEYCODE_SETTINGS
Key code constant: Settings key. Starts the system settings activity. *
@apiSince 11
KEYCODE_SHIFT_LEFT
Added in API level 1
KEYCODE_SHIFT_RIGHT
Added in API level 1
KEYCODE_SLASH
Added in API level 1
Key code constant: Sleep key. Puts the device to sleep. Behaves somewhat
like KEYCODE_POWER but it has no effect if the device is already asleep. *
@apiSince 20
KEYCODE_SOFT_LEFT
public static final int KEYCODE_SOFT_LEFT
Key code constant: Soft Left key. Usually situated below the display on phones
and used as a multi-function feature key for selecting a software defined
function shown on the bottom left of the display. * @apiSince 1
KEYCODE_SOFT_RIGHT
public static final int KEYCODE_SOFT_RIGHT
Key code constant: Soft Right key. Usually situated below the display on
phones and used as a multi-function feature key for selecting a software defined
function shown on the bottom right of the display. * @apiSince 1
KEYCODE_SOFT_SLEEP
Added in API level 24
KEYCODE_SPACE
Added in API level 1
KEYCODE_STAR
Added in API level 1
KEYCODE_STB_INPUT
public static final int KEYCODE_STB_INPUT
Key code constant: Set-top-box input key. On TV remotes, switches the input
mode on an external Set-top-box. * @apiSince 11
KEYCODE_STB_POWER
public static final int KEYCODE_STB_POWER
Key code constant: Set-top-box power key. On TV remotes, toggles the power
on an external Set-top-box. * @apiSince 11
KEYCODE_STEM_1
Added in API level 24
KEYCODE_STEM_2
Added in API level 24
public static final int KEYCODE_STEM_2
KEYCODE_STEM_3
Added in API level 24
KEYCODE_STEM_PRIMARY
public static final int KEYCODE_STEM_PRIMARY
Key code constant: Primary stem key for Wear Main power/reset button on
watch. * @apiSince 24
KEYCODE_SWITCH_CHARSET
public static final int KEYCODE_SWITCH_CHARSET
Key code constant: Switch Charset modifier key. Used to switch character sets
(Kanji, Katakana). * @apiSince 9
KEYCODE_SYM
public static final int KEYCODE_SYM
Key code constant: Symbol modifier key. Used to enter alternate symbols. *
@apiSince 1
KEYCODE_SYSRQ
Added in API level 11
KEYCODE_SYSTEM_NAVIGATION_DOWN
Added in API level 25
KEYCODE_SYSTEM_NAVIGATION_LEFT
Added in API level 25
KEYCODE_SYSTEM_NAVIGATION_RIGHT
Added in API level 25
KEYCODE_SYSTEM_NAVIGATION_UP
Added in API level 25
KEYCODE_TAB
Added in API level 1
KEYCODE_THUMBS_DOWN
Added in API level 29
Key code constant: Thumbs down key. Apps can use this to let user downvote
content.
KEYCODE_THUMBS_UP
Added in API level 29
Key code constant: Thumbs up key. Apps can use this to let user upvote
content.
KEYCODE_TV
public static final int KEYCODE_TV
Key code constant: TV key. On TV remotes, switches to viewing live TV. *
@apiSince 11
KEYCODE_TV_ANTENNA_CABLE
public static final int KEYCODE_TV_ANTENNA_CABLE
KEYCODE_TV_AUDIO_DESCRIPTION
public static final int KEYCODE_TV_AUDIO_DESCRIPTION
Key code constant: Audio description key. Toggles audio description off / on. *
@apiSince 21
KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN
public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN
Key code constant: Audio description mixing volume down key. Lessen audio
description volume as compared with normal audio volume. * @apiSince 21
KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP
public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP
Key code constant: Audio description mixing volume up key. Louden audio
description volume as compared with normal audio volume. * @apiSince 21
KEYCODE_TV_CONTENTS_MENU
public static final int KEYCODE_TV_CONTENTS_MENU
Key code constant: Contents menu key. Goes to the title list. Corresponds to
Contents Menu (0x0B) of CEC User Control Code * @apiSince 21
KEYCODE_TV_DATA_SERVICE
public static final int KEYCODE_TV_DATA_SERVICE
Key code constant: TV data service key. Displays data services like weather,
sports. * @apiSince 21
KEYCODE_TV_INPUT
public static final int KEYCODE_TV_INPUT
KEYCODE_TV_INPUT_COMPONENT_1
public static final int KEYCODE_TV_INPUT_COMPONENT_1
Key code constant: Component #1 key. Switches to component video input #1.
* @apiSince 21
KEYCODE_TV_INPUT_COMPONENT_2
public static final int KEYCODE_TV_INPUT_COMPONENT_2
Key code constant: Component #2 key. Switches to component video input #2.
* @apiSince 21
KEYCODE_TV_INPUT_COMPOSITE_1
public static final int KEYCODE_TV_INPUT_COMPOSITE_1
Key code constant: Composite #1 key. Switches to composite video input #1. *
@apiSince 21
KEYCODE_TV_INPUT_COMPOSITE_2
public static final int KEYCODE_TV_INPUT_COMPOSITE_2
Key code constant: Composite #2 key. Switches to composite video input #2. *
@apiSince 21
KEYCODE_TV_INPUT_HDMI_1
public static final int KEYCODE_TV_INPUT_HDMI_1
Key code constant: HDMI #1 key. Switches to HDMI input #1. * @apiSince 21
KEYCODE_TV_INPUT_HDMI_2
public static final int KEYCODE_TV_INPUT_HDMI_2
Key code constant: HDMI #2 key. Switches to HDMI input #2. * @apiSince 21
KEYCODE_TV_INPUT_HDMI_3
public static final int KEYCODE_TV_INPUT_HDMI_3
Key code constant: HDMI #3 key. Switches to HDMI input #3. * @apiSince 21
KEYCODE_TV_INPUT_HDMI_4
public static final int KEYCODE_TV_INPUT_HDMI_4
KEYCODE_TV_INPUT_VGA_1
final estático público int KEYCODE_TV_INPUT_VGA_1
KEYCODE_TV_MEDIA_CONTEXT_MENU
pública estática final int KEYCODE_TV_MEDIA_CONTEXT_MENU
KEYCODE_TV_NETWORK
public static final int KEYCODE_TV_NETWORK
KEYCODE_TV_NUMBER_ENTRY
public static final int KEYCODE_TV_NUMBER_ENTRY
KEYCODE_TV_POWER
public static final int KEYCODE_TV_POWER
Clave de código constante: tecla de encendido TV. En los controles remotos de
televisión, alterna la alimentación en una pantalla de televisión. * @apiSince 11
KEYCODE_TV_RADIO_SERVICE
public static final int KEYCODE_TV_RADIO_SERVICE
KEYCODE_TV_SATELLITE
public static final int KEYCODE_TV_SATELLITE
KEYCODE_TV_SATELLITE_BS
pública estática final int KEYCODE_TV_SATELLITE_BS
KEYCODE_TV_SATELLITE_CS
pública estática final int KEYCODE_TV_SATELLITE_CS
KEYCODE_TV_SATELLITE_SERVICE
public static final int KEYCODE_TV_SATELLITE_SERVICE
Key code constant: BS/CS key. Toggles between BS and CS digital satellite
services. * @apiSince 21
KEYCODE_TV_TELETEXT
public static final int KEYCODE_TV_TELETEXT
KEYCODE_TV_TERRESTRIAL_ANALOG
public static final int KEYCODE_TV_TERRESTRIAL_ANALOG
KEYCODE_TV_TERRESTRIAL_DIGITAL
public static final int KEYCODE_TV_TERRESTRIAL_DIGITAL
KEYCODE_TV_TIMER_PROGRAMMING
public static final int KEYCODE_TV_TIMER_PROGRAMMING
Key code constant: Timer programming key. Goes to the timer recording menu.
Corresponds to Timer Programming (0x54) of CEC User Control Code. *
@apiSince 21
KEYCODE_TV_ZOOM_MODE
public static final int KEYCODE_TV_ZOOM_MODE
Key code constant: Zoom mode key. Changes Zoom mode (Normal, Full,
Zoom, Wide-zoom, etc.) * @apiSince 21
KEYCODE_U
Added in API level 1
KEYCODE_UNKNOWN
Added in API level 1
KEYCODE_V
Added in API level 1
KEYCODE_VOICE_ASSIST
public static final int KEYCODE_VOICE_ASSIST
Key code constant: Voice Assist key. Launches the global voice assist activity.
Not delivered to applications. * @apiSince 21
KEYCODE_VOLUME_DOWN
public static final int KEYCODE_VOLUME_DOWN
Key code constant: Volume Down key. Adjusts the speaker volume down. *
@apiSince 1
KEYCODE_VOLUME_MUTE
public static final int KEYCODE_VOLUME_MUTE
KEYCODE_VOLUME_UP
public static final int KEYCODE_VOLUME_UP
Key code constant: Volume Up key. Adjusts the speaker volume up. *
@apiSince 1
KEYCODE_W
Added in API level 1
KEYCODE_WAKEUP
public static final int KEYCODE_WAKEUP
Key code constant: Wakeup key. Wakes up the device. Behaves somewhat
like KEYCODE_POWER but it has no effect if the device is already awake. *
@apiSince 20
KEYCODE_X
Added in API level 1
KEYCODE_Y
Added in API level 1
KEYCODE_YEN
Added in API level 16
KEYCODE_Z
Added in API level 1
KEYCODE_ZENKAKU_HANKAKU
Added in API level 16
KEYCODE_ZOOM_IN
Added in API level 11
KEYCODE_ZOOM_OUT
Added in API level 11
MAX_KEYCODE
Added in API level 1
Deprecated in API level 15
This mask is used to check whether the left ALT meta key is pressed.
See also:
isAltPressed()
getMetaState()
KEYCODE_ALT_LEFT
META_ALT_MASK
Added in API level 11
META_ALT_ON
Added in API level 1
This mask is used to check whether one of the ALT meta keys is pressed.
See also:
isAltPressed()
getMetaState()
KEYCODE_ALT_LEFT
KEYCODE_ALT_RIGHT
This mask is used to check whether the right the ALT meta key is pressed.
See also:
isAltPressed()
getMetaState()
KEYCODE_ALT_RIGHT
META_CAPS_LOCK_ON
Added in API level 11
This mask is used to check whether the CAPS LOCK meta key is on.
See also:
isCapsLockOn()
getMetaState()
KEYCODE_CAPS_LOCK
META_CTRL_LEFT_ON
Added in API level 11
This mask is used to check whether the left CTRL meta key is pressed.
See also:
isCtrlPressed()
getMetaState()
KEYCODE_CTRL_LEFT
Constant Value: 8192 (0x00002000)
META_CTRL_MASK
Added in API level 11
META_CTRL_ON
Added in API level 11
This mask is used to check whether one of the CTRL meta keys is pressed.
See also:
isCtrlPressed()
getMetaState()
KEYCODE_CTRL_LEFT
KEYCODE_CTRL_RIGHT
META_CTRL_RIGHT_ON
Added in API level 11
This mask is used to check whether the right CTRL meta key is pressed.
See also:
isCtrlPressed()
getMetaState()
KEYCODE_CTRL_RIGHT
This mask is used to check whether the FUNCTION meta key is pressed.
See also:
isFunctionPressed()
getMetaState()
META_META_LEFT_ON
Added in API level 11
This mask is used to check whether the left META meta key is pressed.
See also:
isMetaPressed()
getMetaState()
KEYCODE_META_LEFT
META_META_MASK
Added in API level 11
META_META_ON
Añadido en el nivel API 11
public static final int META_META_ON
Esta máscara se usa para verificar si se presiona una de las teclas META.
Ver también:
isMetaPressed()
getMetaState()
KEYCODE_META_LEFT
KEYCODE_META_RIGHT
META_META_RIGHT_ON
Añadido en el nivel API 11
Esta máscara se usa para verificar si se presiona la tecla meta META correcta.
Ver también:
isMetaPressed()
getMetaState()
KEYCODE_META_RIGHT
META_NUM_LOCK_ON
Añadido en el nivel API 11
Esta máscara se usa para verificar si la meta clave NUM LOCK está activada.
Ver también:
isNumLockOn()
getMetaState()
KEYCODE_NUM_LOCK
Esta máscara se usa para verificar si la meta clave SCROLL LOCK está
activada.
Ver también:
isScrollLockOn()
getMetaState()
KEYCODE_SCROLL_LOCK
META_SHIFT_LEFT_ON
Añadido en el nivel API 1
Ver también:
isShiftPressed()
getMetaState()
KEYCODE_SHIFT_LEFT
META_SHIFT_MASK
Añadido en el nivel API 11
Ver también:
isShiftPressed()
getMetaState()
KEYCODE_SHIFT_LEFT
KEYCODE_SHIFT_RIGHT
META_SHIFT_RIGHT_ON
Added in API level 1
This mask is used to check whether the right SHIFT meta key is pressed.
See also:
isShiftPressed()
getMetaState()
KEYCODE_SHIFT_RIGHT
META_SYM_ON
Added in API level 1
This mask is used to check whether the SYM meta key is pressed.
See also:
isSymPressed()
getMetaState()
Fields
CREATOR
Added in API level 1
Public constructors
KeyEvent
Added in API level 1
int code)
Parameters
KeyEvent
Added in API level 1
long eventTime,
int action,
int code,
int repeat)
Parameters
downTime long: The time (in SystemClock.uptimeMillis()) at which this key code originally went d
eventTime long: The time (in SystemClock.uptimeMillis()) at which this event happened.
repeat int: A repeat count for down events (> 0 if this is after the initial down) or event count for mult
KeyEvent
Added in API level 1
long eventTime,
int action,
int code,
int repeat,
int metaState)
Parameters
downTime long: The time (in SystemClock.uptimeMillis()) at which this key code originally went d
eventTime long: The time (in SystemClock.uptimeMillis()) at which this event happened.
repeat int: A repeat count for down events (> 0 if this is after the initial down) or event count for mult
metaState int: Flags indicating which meta keys are currently pressed.
KeyEvent
Added in API level 1
long eventTime,
int action,
int code,
int repeat,
int metaState,
int deviceId,
int scancode)
Parameters
downTime long: The time (in SystemClock.uptimeMillis()) at which this key code originally went d
eventTime long: The time (in SystemClock.uptimeMillis()) at which this event happened.
repeat int: A repeat count for down events (> 0 if this is after the initial down) or event count for mult
metaState int: Flags indicating which meta keys are currently pressed.
KeyEvent
Added in API level 1
public KeyEvent (long downTime,
long eventTime,
int action,
int code,
int repeat,
int metaState,
int deviceId,
int scancode,
int flags)
Parameters
downTime long: The time (in SystemClock.uptimeMillis()) at which this key code originally went d
eventTime long: The time (in SystemClock.uptimeMillis()) at which this event happened.
repeat int: A repeat count for down events (> 0 if this is after the initial down) or event count for mult
metaState int: Flags indicating which meta keys are currently pressed.
KeyEvent
Added in API level 9
long eventTime,
int action,
int code,
int repeat,
int metaState,
int deviceId,
int scancode,
int flags,
int source)
Parameters
downTime long: The time (in SystemClock.uptimeMillis()) at which this key code originally went d
eventTime long: The time (in SystemClock.uptimeMillis()) at which this event happened.
repeat int: A repeat count for down events (> 0 if this is after the initial down) or event count for mult
metaState int: Flags indicating which meta keys are currently pressed.
KeyEvent
Added in API level 3
String characters,
int deviceId,
int flags)
Create a new key event for a string of characters. The key code, action, repeat
count and source will automatically be set
to KEYCODE_UNKNOWN, ACTION_MULTIPLE, 0,
and InputDevice#SOURCE_KEYBOARD for you.
Parameters
time long: The time (in SystemClock.uptimeMillis()) at which this event occured.
KeyEvent
Added in API level 3
Parameters
origEvent KeyEvent
KeyEvent
Added in API level 1
long eventTime,
int newRepeat)
Parameters
eventTime long: The new event time (in SystemClock.uptimeMillis()) of the event.
Public methods
changeAction
Added in API level 3
int action)
Create a new key event that is the same as the given one, but whose action is
replaced with the given value.
Parameters
Returns
KeyEvent
changeFlags
Added in API level 3
int flags)
Create a new key event that is the same as the given one, but whose flags are
replaced with the given value.
Parameters
Returns
KeyEvent
changeTimeRepeat
Added in API level 5
long eventTime,
int newRepeat,
int newFlags)
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.
Parameters
eventTime long: The new event time (in SystemClock.uptimeMillis()) of the event.
newFlags int: New flags for the event, replacing the entire value in the original event.
Returns
KeyEvent
changeTimeRepeat
Added in API level 3
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.
Parameters
eventTime long: The new event time (in SystemClock.uptimeMillis()) of the event.
Returns
KeyEvent
dispatch
Added in API level 5
KeyEvent.DispatcherState state,
Object target)
Parameters
Returns
boolean The return value from the Callback method that was called.
dispatch
Added in API level 1
Deprecated in API level 15
Parameters
receiver KeyEvent.Callback
Returns
boolean
getAction
Added in API level 1
Retrieve the action of this key event. May be either ACTION_DOWN, ACTION_UP,
or ACTION_MULTIPLE.
Returns
Returns
getDeadChar
Added in API level 1
int c)
Get the character that is produced by putting accent on the character c. For
example, getDeadChar('`', 'e') returns è.
Parameters
accent int
c int
Returns
int
getDeviceId
Added in API level 1
public final int getDeviceId ()
Gets the id for the device that this event came from. An id of zero indicates that
the event didn't come from a physical device and maps to the default keymap.
The other numbers are arbitrary and you shouldn't depend on the values.
Returns
getDisplayLabel
Added in API level 1
Gets the primary character for this key. In other words, the label that is
physically printed on it.
Returns
char The display label character, or 0 if none (eg. for non-printing keys).
getDownTime
Added in API level 1
Returns
long Returns the most recent key down time, in the SystemClock.uptimeMillis() time base
getEventTime
Added in API level 1
Returns
long Returns the time this event occurred, in the SystemClock.uptimeMillis() time base.
getFlags
Added in API level 1
Returns
int
See also:
FLAG_WOKE_HERE
getKeyCharacterMap
Added in API level 11
Returns
Throws
android.view.KeyCharacterMap.UnavailableException KeyCharacterMap.UnavailableE
key character map could not be loaded because it was malformed or the default key ch
missing from the system.
See also:
KeyCharacterMap.load(int)
getKeyCode
Added in API level 1
Retrieve the key code of the key event. This is the physical key that was
pressed, not the Unicode character.
Returns
getKeyData
Added in API level 1
Deprecated in API level 15
Parameters
Returns
boolean True if the key was mapped. If the key was not mapped, results is not modified.
getMatch
Added in API level 1
int metaState)
Gets the first character in the character array that can be generated by the
specified key code. If there are multiple choices, prefers the one that would be
generated with the specified meta key modifier state.
Parameters
Returns
getMatch
Added in API level 1
Gets the first character in the character array that can be generated by the
specified key code.
Parameters
Returns
Returns
int
getMetaState
Added in API level 1
Returns
int an integer in which each bit set to 1 represents a pressed meta key
See also:
isAltPressed()
isShiftPressed()
isSymPressed()
isCtrlPressed()
isMetaPressed()
isFunctionPressed()
isCapsLockOn()
isNumLockOn()
isScrollLockOn()
META_ALT_ON
META_ALT_LEFT_ON
META_ALT_RIGHT_ON
META_SHIFT_ON
META_SHIFT_LEFT_ON
META_SHIFT_RIGHT_ON
META_SYM_ON
META_FUNCTION_ON
META_CTRL_ON
META_CTRL_LEFT_ON
META_CTRL_RIGHT_ON
META_META_ON
META_META_LEFT_ON
META_META_RIGHT_ON
META_CAPS_LOCK_ON
META_NUM_LOCK_ON
META_SCROLL_LOCK_ON
getModifiers()
getModifierMetaStateMask
Added in API level 11
Gets a mask that includes all valid modifier key meta state bits.
getModifiers
Added in API level 13
Returns
int An integer in which each bit set to 1 represents a pressed modifier key.
See also:
getMetaState()
getNumber
Added in API level 1
The character value is returned, not the numeric value. If the key is not a
number, but is a symbol, the symbol is retuned.
This method is intended to to support dial pads and other numeric or symbolic
entry on keyboards where certain keys serve dual function as alphabetic and
symbolic keys. This method returns the number or symbol associated with the
key independent of whether the user has pressed the required modifier.
For example, on one particular keyboard the keys on the top QWERTY row
generate numbers when ALT is pressed such that ALT-Q maps to '1'. So for
that keyboard when getNumber() is called with KeyEvent#KEYCODE_Q it returns
'1' so that the user can type numbers without pressing ALT when it makes
sense.
Returns
getRepeatCount
Added in API level 1
Retrieve the repeat count of the event. For key down events, this is the number
of times the key has repeated with the first down starting at 0 and counting up
from there. For key up events, this is always equal to zero. For multiple key
events, this is the number of down/up pairs that have occurred.
Returns
getScanCode
Added in API level 1
Retrieve the hardware key id of this key event. These values are not reliable
and vary from device to device.
Returns
int
getSource
Added in API level 9
Returns
getUnicodeChar
Added in API level 1
Gets the Unicode character generated by the specified key and meta key state
combination.
Returns the Unicode character that the specified key would produce when the
specified meta bits (see MetaKeyKeyListener) were active.
Returns 0 if the key is not one that is used to type Unicode characters.
Parameters
Returns
getUnicodeChar
Added in API level 1
Gets the Unicode character generated by the specified key and meta key state
combination.
Returns the Unicode character that the specified key would produce when the
specified meta bits (see MetaKeyKeyListener) were active.
Returns 0 if the key is not one that is used to type Unicode characters.
Returns
hasModifiers
Added in API level 11
Returns true if only the specified modifiers keys are pressed. Returns false if a
different combination of modifier keys are pressed.
Parameters
modifiers int: The meta state of the modifier keys to check. May be a combination of modifier meta stat
by getModifierMetaStateMask(). May be 0 to ensure that no modifier keys are pressed.
Returns
Throws
See also:
metaStateHasModifiers(int, int)
hasNoModifiers
Added in API level 11
Returns
See also:
metaStateHasNoModifiers(int)
isAltPressed
Added in API level 1
Returns
See also:
KEYCODE_ALT_LEFT
KEYCODE_ALT_RIGHT
META_ALT_ON
isCanceled
Added in API level 5
Devoluciones
boolean
isCapsLockOn
Añadido en el nivel API 11
Devoluciones
Ver también:
KEYCODE_CAPS_LOCK
META_CAPS_LOCK_ON
está presionado
Añadido en el nivel API 11
Devoluciones
Ver también:
KEYCODE_CTRL_LEFT
KEYCODE_CTRL_RIGHT
META_CTRL_ON
isFunctionPressed
Añadido en el nivel API 11
Devoluciones
Ver también:
KEYCODE_FUNCTION
META_FUNCTION_ON
isGamepadButton
Añadido en el nivel API 12
booleano final estático público isGamepadButton (int keyCode)
Parámetros
keyCode int
Devoluciones
isLongPress
Añadido en el nivel 5 de API
Devoluciones
boolean
isMetaPressed
Añadido en el nivel API 11
Devoluciones
Ver también:
KEYCODE_META_LEFT
KEYCODE_META_RIGHT
META_META_ON
isModifierKey
Añadido en el nivel API 1
Parámetros
keyCode int
Devoluciones
isNumLockOn
Added in API level 11
Returns
See also:
KEYCODE_NUM_LOCK
META_NUM_LOCK_ON
isPrintingKey
Added in API level 1
Returns
isScrollLockOn
Added in API level 11
Returns
See also:
KEYCODE_SCROLL_LOCK
META_SCROLL_LOCK_ON
isShiftPressed
Added in API level 1
Returns
KEYCODE_SHIFT_LEFT
KEYCODE_SHIFT_RIGHT
META_SHIFT_ON
isSymPressed
Added in API level 1
Returns
See also:
KEYCODE_SYM
META_SYM_ON
isSystem
Added in API level 1
Is this a system key? System keys can not be used for menu shortcuts.
Returns
boolean
isTracking
Added in API level 5
Returns
boolean
keyCodeFromString
Added in API level 12
Parameters
symbolicName String: The symbolic name of the keycode. This value must never be null.
Returns
See also:
keyCodeToString(int)
keyCodeToString
Added in API level 12
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. This function is intended to be used mostly
for debugging, logging, and testing. It is not locale-specific and is not intended
to be used in a user-facing manner.
Parameters
Returns
See also:
KeyCharacterMap.getDisplayLabel(int)
metaStateHasModifiers
Added in API level 11
int modifiers)
Returns true if only the specified modifier keys are pressed according to the
specified meta state. Returns false if a different combination of modifier keys
are pressed.
Parameters
Devoluciones
Tiros
Ver también:
hasModifiers(int)
metaStateHasNoModifiers
Añadido en el nivel API 11
Parámetros
Devoluciones
hasNoModifiers()
normalizeMetaState
Añadido en el nivel API 11
El estado meta se normaliza de tal manera que si se establecen los bits del
estado meta del modificador izquierdo o derecho, el resultado también incluirá
el bit universal para ese modificador.
Parámetros
Devoluciones
setSource
Añadido en el nivel API 12
source int
iniciar el seguimiento
Añadido en el nivel 5 de API
Devoluciones
writeToParcel
Añadido en el nivel API 1
Parámetros
flags int: Banderas adicionales sobre cómo se debe escribir el objeto. Puede ser 0 o . El valor es una co
deandroid.os.Parcelable.PARCELABLE_ELIDE_DUPLICATESParcelable.PARCELABLE_WRITE