Interface KeyData

The data of keyboard-based user interactions. Based on: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent (documentation extracted from here)

interface KeyData {
    altKey: boolean;
    code: string;
    ctrlKey: boolean;
    currentTarget: null | EventTarget;
    key: string;
    location: number;
    metaKey: boolean;
    repeat: boolean;
    shiftKey: boolean;
    target: null | EventTarget;
    timeStamp: number;
}

Hierarchy

Implemented by

Properties

altKey: boolean

True if the alt key was down when the mouse event was fired.

code: string

A string with the code value of the physical key represented by the event. Warning: This ignores the user's keyboard layout, so that if the user presses the key at the "Y" position in a QWERTY keyboard layout this will always return "KeyY", even if the user has a QWERTZ keyboard.

ctrlKey: boolean

True if the control key was down when the mouse event was fired.

currentTarget: null | EventTarget

A reference to the currently registered target for the event. This is the object to which the event is currently slated to be sent. It's possible this has been changed along the way through retargeting.

key: string

A string that represents the key value of the key represented by the event.

location: number

A number that represents the location of the key on the keyboard or other input device.

metaKey: boolean

True if the meta key was down when the mouse event was fired.

repeat: boolean

A boolean that is true if the key is being held down such that it is automatically repeating.

shiftKey: boolean

True if the shift key was down when the mouse event was fired.

target: null | EventTarget

A reference to the target to which the event was originally dispatched.

timeStamp: number

The time at which the event was created (in milliseconds). By specification, this value is time since epoch—but in reality, browsers' definitions vary. In addition, work is underway to change this to be a DOMHighResTimeStamp instead.

Generated using TypeDoc