utf16CodePoint

Property

Common
expect val KeyEvent.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).

Android
actual val KeyEvent.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).

If the return value has bit KeyCharacterMap.COMBINING_ACCENT set, the key is a "dead key" that should be combined with another to actually produce a character -- see KeyCharacterMap.getDeadChar -- after masking with KeyCharacterMap.COMBINING_ACCENT_MASK.