interface KeyboardEventContext {
    key: string;
    event: KeyboardEvent;
    isShift: boolean;
    isControl: boolean;
    isAlt: boolean;
    hasModifier: boolean;
    modifiers: string[];
    up: boolean;
    repeat: boolean;
    action: string;
}

Properties

key: string

The normalized string key, such as "A"

event: KeyboardEvent

The originating keypress event

isShift: boolean

Is the Shift modifier being pressed

isControl: boolean

Is the Control or Meta modifier being processed

isAlt: boolean

Is the Alt modifier being pressed

hasModifier: boolean

Are any of the modifiers being pressed

modifiers: string[]

A list of string modifiers applied to this context, such as [ "CONTROL" ]

up: boolean

True if the Key is Up, else False if down

repeat: boolean

True if the given key is being held down such that it is automatically repeating.

action: string

The executing Keybinding Action. May be undefined until the action is known.