Canvas Toolkit
← Class index

CKeyEvent

Events · extends CEvent

Event describing a keyboard key press or release.

import { CKeyEvent } from "canvas-toolkit-lib";

Declared members

constructor(type: CEventType, key: string, ctrl?: boolean, shift?: boolean, alt?: boolean, meta?: boolean, code?: string, altGraph?: boolean);

Creates a keyboard event. @param type Keyboard event type. @param key Key value reported by the browser. @param ctrl Whether Control is pressed. @param shift Whether Shift is pressed. @param alt Whether Alt is pressed. @param meta Whether Meta is pressed. @param code Physical key code reported by the browser. @param altGraph Whether AltGraph is active.

key(): string;

Returns the key value.

ctrl(): boolean;

Returns whether Control is pressed.

shift(): boolean;

Returns whether Shift is pressed.

alt(): boolean;

Returns whether Alt is pressed.

meta(): boolean;

Returns whether Meta is pressed.

code(): string;

Returns the physical key code.

altGraph(): boolean;

Returns whether AltGraph is active.