Raw keyboard event received by Keyboard.OnRawEvent.

interface KeyEvent {
    type: "down" | "up";
    virtual_key: number;
    scan_code: number;
    flags: number;
    modifier_flags: number;
    device_id: null | string;
}

Properties

type: "down" | "up"

"down" when the key is pressed, "up" when released.

virtual_key: number

Windows virtual-key code (e.g. 0x41 for the A key).

scan_code: number

Hardware scan code of the key.

flags: number

Raw event flags from the low-level keyboard hook.

modifier_flags: number

Modifier-state bitfield captured at the time this event was received.

device_id: null | string

Device path identifying the physical keyboard that generated the event, or null if unavailable.