Scancode

value class Scancode(val code: UInt)(source)

A physical key position on the keyboard, identified by SDL's scancode.

A scancode names where a key sits, not what it types: W is the key where W sits on a US layout, which types z on a French layout. Use scancodes for controls that depend on position, such as movement on W, A, S and D; use KeyCode for text and prompts that name a key's label.

Every scancode SDL reports is below COUNT, so keyboard state can live in a flat array indexed by code. UNKNOWN stands for a key SDL cannot identify.

Constructors

Link copied to clipboard
constructor(code: UInt)

Types

Link copied to clipboard
object Companion

Holds the scancodes, which name physical key positions.

Properties

Link copied to clipboard
val code: UInt

Functions

Link copied to clipboard
open override fun toString(): String