1 | import type { Instance } from '../setup';
|
2 | import type { System } from '.';
|
3 | export declare enum DOM_KEY_LOCATION {
|
4 | STANDARD = 0,
|
5 | LEFT = 1,
|
6 | RIGHT = 2,
|
7 | NUMPAD = 3
|
8 | }
|
9 | export interface keyboardKey {
|
10 |
|
11 | code?: string;
|
12 |
|
13 | key?: string;
|
14 |
|
15 | location?: DOM_KEY_LOCATION;
|
16 |
|
17 | altGr?: boolean;
|
18 |
|
19 | shift?: boolean;
|
20 | }
|
21 | export declare class KeyboardHost {
|
22 | readonly system: System;
|
23 | constructor(system: System);
|
24 | readonly modifiers: {
|
25 | Alt: boolean;
|
26 | AltGraph: boolean;
|
27 | CapsLock: boolean;
|
28 | Control: boolean;
|
29 | Fn: boolean;
|
30 | FnLock: boolean;
|
31 | Meta: boolean;
|
32 | NumLock: boolean;
|
33 | ScrollLock: boolean;
|
34 | Shift: boolean;
|
35 | Symbol: boolean;
|
36 | SymbolLock: boolean;
|
37 | };
|
38 | readonly pressed: Record<string, {
|
39 | keyDef: keyboardKey;
|
40 | unpreventedDefault: boolean;
|
41 | }>;
|
42 | carryChar: string;
|
43 | private lastKeydownTarget;
|
44 | private readonly modifierLockStart;
|
45 | isKeyPressed(keyDef: keyboardKey): boolean;
|
46 | getPressedKeys(): keyboardKey[];
|
47 |
|
48 | keydown(instance: Instance, keyDef: keyboardKey): Promise<void>;
|
49 |
|
50 | keyup(instance: Instance, keyDef: keyboardKey): Promise<void>;
|
51 | private setKeydownTarget;
|
52 | private hasKeyPress;
|
53 | }
|