Key.kt
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.compose.ui.input.key
import androidx.compose.ui.ExperimentalComposeUiApi
/**
* Represents keys on a keyboard.
*
* @param keyCode a Long value representing the key pressed. Note: This keycode can be used to
* uniquely identify a hardware key. It is different from the native keycode.
*
* @sample androidx.compose.ui.samples.KeyEventIsAltPressedSample
*/
@kotlin.jvm.JvmInline
expect value class Key(val keyCode: Long) {
companion object {
/** Unknown key. */
@ExperimentalComposeUiApi
val Unknown: Key
/**
* 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.
*/
@ExperimentalComposeUiApi
val SoftLeft: Key
/**
* 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.
*/
@ExperimentalComposeUiApi
val SoftRight: Key
/**
* Home key.
*
* This key is handled by the framework and is never delivered to applications.
*/
@ExperimentalComposeUiApi
val Home: Key
/** Back key. */
@ExperimentalComposeUiApi
val Back: Key
/** Help key. */
@ExperimentalComposeUiApi
val Help: Key
/**
* Navigate to previous key.
*
* Goes backward by one item in an ordered collection of items.
*/
@ExperimentalComposeUiApi
val NavigatePrevious: Key
/**
* Navigate to next key.
*
* Advances to the next item in an ordered collection of items.
*/
@ExperimentalComposeUiApi
val NavigateNext: Key
/**
* Navigate in key.
*
* Activates the item that currently has focus or expands to the next level of a navigation
* hierarchy.
*/
@ExperimentalComposeUiApi
val NavigateIn: Key
/**
* Navigate out key.
*
* Backs out one level of a navigation hierarchy or collapses the item that currently has
* focus.
*/
@ExperimentalComposeUiApi
val NavigateOut: Key
/** Consumed by the system for navigation up. */
@ExperimentalComposeUiApi
val SystemNavigationUp: Key
/** Consumed by the system for navigation down. */
@ExperimentalComposeUiApi
val SystemNavigationDown: Key
/** Consumed by the system for navigation left. */
@ExperimentalComposeUiApi
val SystemNavigationLeft: Key
/** Consumed by the system for navigation right. */
@ExperimentalComposeUiApi
val SystemNavigationRight: Key
/** Call key. */
@ExperimentalComposeUiApi
val Call: Key
/** End Call key. */
@ExperimentalComposeUiApi
val EndCall: Key
/**
* Up Arrow Key / Directional Pad Up key.
*
* May also be synthesized from trackball motions.
*/
@ExperimentalComposeUiApi
val DirectionUp: Key
/**
* Down Arrow Key / Directional Pad Down key.
*
* May also be synthesized from trackball motions.
*/
@ExperimentalComposeUiApi
val DirectionDown: Key
/**
* Left Arrow Key / Directional Pad Left key.
*
* May also be synthesized from trackball motions.
*/
@ExperimentalComposeUiApi
val DirectionLeft: Key
/**
* Right Arrow Key / Directional Pad Right key.
*
* May also be synthesized from trackball motions.
*/
@ExperimentalComposeUiApi
val DirectionRight: Key
/**
* Center Arrow Key / Directional Pad Center key.
*
* May also be synthesized from trackball motions.
*/
@ExperimentalComposeUiApi
val DirectionCenter: Key
/** Directional Pad Up-Left. */
@ExperimentalComposeUiApi
val DirectionUpLeft: Key
/** Directional Pad Down-Left. */
@ExperimentalComposeUiApi
val DirectionDownLeft: Key
/** Directional Pad Up-Right. */
@ExperimentalComposeUiApi
val DirectionUpRight: Key
/** Directional Pad Down-Right. */
@ExperimentalComposeUiApi
val DirectionDownRight: Key
/**
* Volume Up key.
*
* Adjusts the speaker volume up.
*/
@ExperimentalComposeUiApi
val VolumeUp: Key
/**
* Volume Down key.
*
* Adjusts the speaker volume down.
*/
@ExperimentalComposeUiApi
val VolumeDown: Key
/** Power key. */
@ExperimentalComposeUiApi
val Power: Key
/**
* Camera key.
*
* Used to launch a camera application or take pictures.
*/
@ExperimentalComposeUiApi
val Camera: Key
/** Clear key. */
@ExperimentalComposeUiApi
val Clear: Key
/** '0' key. */
@ExperimentalComposeUiApi
val Zero: Key
/** '1' key. */
@ExperimentalComposeUiApi
val One: Key
/** '2' key. */
@ExperimentalComposeUiApi
val Two: Key
/** '3' key. */
@ExperimentalComposeUiApi
val Three: Key
/** '4' key. */
@ExperimentalComposeUiApi
val Four: Key
/** '5' key. */
@ExperimentalComposeUiApi
val Five: Key
/** '6' key. */
@ExperimentalComposeUiApi
val Six: Key
/** '7' key. */
@ExperimentalComposeUiApi
val Seven: Key
/** '8' key. */
@ExperimentalComposeUiApi
val Eight: Key
/** '9' key. */
@ExperimentalComposeUiApi
val Nine: Key
/** '+' key. */
@ExperimentalComposeUiApi
val Plus: Key
/** '-' key. */
@ExperimentalComposeUiApi
val Minus: Key
/** '*' key. */
@ExperimentalComposeUiApi
val Multiply: Key
/** '=' key. */
@ExperimentalComposeUiApi
val Equals: Key
/** '#' key. */
@ExperimentalComposeUiApi
val Pound: Key
/** 'A' key. */
@ExperimentalComposeUiApi
val A: Key
/** 'B' key. */
@ExperimentalComposeUiApi
val B: Key
/** 'C' key. */
@ExperimentalComposeUiApi
val C: Key
/** 'D' key. */
@ExperimentalComposeUiApi
val D: Key
/** 'E' key. */
@ExperimentalComposeUiApi
val E: Key
/** 'F' key. */
@ExperimentalComposeUiApi
val F: Key
/** 'G' key. */
@ExperimentalComposeUiApi
val G: Key
/** 'H' key. */
@ExperimentalComposeUiApi
val H: Key
/** 'I' key. */
@ExperimentalComposeUiApi
val I: Key
/** 'J' key. */
@ExperimentalComposeUiApi
val J: Key
/** 'K' key. */
@ExperimentalComposeUiApi
val K: Key
/** 'L' key. */
@ExperimentalComposeUiApi
val L: Key
/** 'M' key. */
@ExperimentalComposeUiApi
val M: Key
/** 'N' key. */
@ExperimentalComposeUiApi
val N: Key
/** 'O' key. */
@ExperimentalComposeUiApi
val O: Key
/** 'P' key. */
@ExperimentalComposeUiApi
val P: Key
/** 'Q' key. */
@ExperimentalComposeUiApi
val Q: Key
/** 'R' key. */
@ExperimentalComposeUiApi
val R: Key
/** 'S' key. */
@ExperimentalComposeUiApi
val S: Key
/** 'T' key. */
@ExperimentalComposeUiApi
val T: Key
/** 'U' key. */
@ExperimentalComposeUiApi
val U: Key
/** 'V' key. */
@ExperimentalComposeUiApi
val V: Key
/** 'W' key. */
@ExperimentalComposeUiApi
val W: Key
/** 'X' key. */
@ExperimentalComposeUiApi
val X: Key
/** 'Y' key. */
@ExperimentalComposeUiApi
val Y: Key
/** 'Z' key. */
@ExperimentalComposeUiApi
val Z: Key
/** ',' key. */
@ExperimentalComposeUiApi
val Comma: Key
/** '.' key. */
@ExperimentalComposeUiApi
val Period: Key
/** Left Alt modifier key. */
@ExperimentalComposeUiApi
val AltLeft: Key
/** Right Alt modifier key. */
@ExperimentalComposeUiApi
val AltRight: Key
/** Left Shift modifier key. */
@ExperimentalComposeUiApi
val ShiftLeft: Key
/** Right Shift modifier key. */
@ExperimentalComposeUiApi
val ShiftRight: Key
/** Tab key. */
@ExperimentalComposeUiApi
val Tab: Key
/** Space key. */
@ExperimentalComposeUiApi
val Spacebar: Key
/**
* Symbol modifier key.
*
* Used to enter alternate symbols.
*/
@ExperimentalComposeUiApi
val Symbol: Key
/**
* Browser special function key.
*
* Used to launch a browser application.
*/
@ExperimentalComposeUiApi
val Browser: Key
/**
* Envelope special function key.
*
* Used to launch a mail application.
*/
@ExperimentalComposeUiApi
val Envelope: Key
/** Enter key. */
@ExperimentalComposeUiApi
val Enter: Key
/**
* Backspace key.
*
* Deletes characters before the insertion point, unlike [Delete].
*/
@ExperimentalComposeUiApi
val Backspace: Key
/**
* Delete key.
*
* Deletes characters ahead of the insertion point, unlike [Backspace].
*/
@ExperimentalComposeUiApi
val Delete: Key
/** Escape key. */
@ExperimentalComposeUiApi
val Escape: Key
/** Left Control modifier key. */
@ExperimentalComposeUiApi
val CtrlLeft: Key
/** Right Control modifier key. */
@ExperimentalComposeUiApi
val CtrlRight: Key
/** Caps Lock key. */
@ExperimentalComposeUiApi
val CapsLock: Key
/** Scroll Lock key. */
@ExperimentalComposeUiApi
val ScrollLock: Key
/** Left Meta modifier key. */
@ExperimentalComposeUiApi
val MetaLeft: Key
/** Right Meta modifier key. */
@ExperimentalComposeUiApi
val MetaRight: Key
/** Function modifier key. */
@ExperimentalComposeUiApi
val Function: Key
/** System Request / Print Screen key. */
@ExperimentalComposeUiApi
val PrintScreen: Key
/** Break / Pause key. */
@ExperimentalComposeUiApi
val Break: Key
/**
* Home Movement key.
*
* Used for scrolling or moving the cursor around to the start of a line
* or to the top of a list.
*/
@ExperimentalComposeUiApi
val MoveHome: Key
/**
* End Movement key.
*
* Used for scrolling or moving the cursor around to the end of a line
* or to the bottom of a list.
*/
@ExperimentalComposeUiApi
val MoveEnd: Key
/**
* Insert key.
*
* Toggles insert / overwrite edit mode.
*/
@ExperimentalComposeUiApi
val Insert: Key
/** Cut key. */
@ExperimentalComposeUiApi
val Cut: Key
/** Copy key. */
@ExperimentalComposeUiApi
val Copy: Key
/** Paste key. */
@ExperimentalComposeUiApi
val Paste: Key
/** '`' (backtick) key. */
@ExperimentalComposeUiApi
val Grave: Key
/** '[' key. */
@ExperimentalComposeUiApi
val LeftBracket: Key
/** ']' key. */
@ExperimentalComposeUiApi
val RightBracket: Key
/** '/' key. */
@ExperimentalComposeUiApi
val Slash: Key
/** '