Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.

KeyEvent

interface KeyEvent
androidx.compose.ui.input.key.KeyEvent

When a user presses a key on a hardware keyboard, a KeyEvent is sent to the KeyInputModifier that is currently active.

Summary

Properties
abstract Alt

Indicates the status of the Alt key.

abstract Key

The key that was pressed.

abstract KeyEventType

The type of key event.

abstract Int

The UTF16 value corresponding to the key event that was pressed.

Properties

alt

abstract val alt: Alt

Indicates the status of the Alt key.

key

abstract val key: Key

The key that was pressed.

type

abstract val type: KeyEventType

The type of key event.

utf16CodePoint

abstract val utf16CodePoint: Int

The UTF16 value corresponding to the key event that was pressed. The unicode character takes into account any meta keys that are pressed (eg. Pressing shift results in capital alphabets). The UTF16 value uses the U+n notation of the Unicode Standard.

An Int is used instead of a Char so that we can support supplementary characters. The Unicode Standard allows for characters whose representation requires more than 16 bits. The range of legal code points is U+0000 to U+10FFFF, known as Unicode scalar value.

The set of characters from U+0000 to U+FFFF is sometimes referred to as the Basic Multilingual Plane (BMP). Characters whose code points are greater than U+FFFF are called supplementary characters. In this representation, supplementary characters are represented as a pair of char values, the first from the high-surrogates range, (\uD800-\uDBFF), the second from the low-surrogates range (\uDC00-\uDFFF).