Interface KeyPressEvent

Represents a keydown or auto-repeated keydown event.

Use keyPressEventFromHTMLEvent where possible rather than constructing directly (required properties may change between minor releases).

interface KeyPressEvent {
    altKey: undefined | boolean;
    code: string;
    ctrlKey: undefined | boolean;
    key: string;
    kind: KeyPressEvent;
    shiftKey: undefined | boolean;
}

Hierarchy

  • BaseKeyEvent
    • KeyPressEvent

Properties

altKey: undefined | boolean

If falsey, the alt key is not pressed.

code: string
ctrlKey: undefined | boolean

If ctrlKey is undefined, that is equivalent to ctrlKey = false.

key: string

key, as given by an HTML KeyboardEvent

shiftKey: undefined | boolean

If falsey, the shift key is not pressed.

OpenSource licenses