Raw keyboard event received by Keyboard.OnRawEvent.

interface KeyEvent {
    type: "down" | "up";
    virtual_key: number;
    scan_code: number;
    flags: number;
    device_id?: 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.

device_id?: string

Device path identifying the physical keyboard that generated the event.