menu
KeyboardState
import { KeyboardState } from "destack:input/binding";
Keyboard state snapshot.
1export struct KeyboardState {2 timestampNs: uint64;3 sequence: uint64;4 deviceId: string;5 hostModifiers: uint32;6 modifiers: ModifierState;7 pressedCodes: string[];8 pressedKeys: string[];9 pressedHostCodes: uint32[];10 pressedScanCodes: uint32[];11 layout: KeyboardLayout;12 isComposing: boolean;13}Members
timestampNs: uint64Monotonic update timestamp in nanoseconds.
sequence: uint64Monotonic sequence number generated by the host stream.
deviceId: stringStable source device identifier.
hostModifiers: uint32Host modifier bitset.
modifiers: ModifierStateKeyboard modifier and lock state.
pressedCodes: string[]Normalized physical codes currently pressed.
pressedKeys: string[]Normalized logical keys currently pressed.
pressedHostCodes: uint32[]Host key codes currently pressed.
pressedScanCodes: uint32[]Host hardware scan codes currently pressed when available.
layout: KeyboardLayoutActive layout when available.
isComposing: booleanWhether the keyboard is currently within one active composition session.