Skip to content

KeyboardLock beta ​

Class of @v12-engine/client

ts
export declare class KeyboardLock

The keys the game uses, asked of the browser in full screen (client.keyboardLock), so that Esc is the game's and not the browser's way out of full screen (held down, it still is), and F keys, Ctrl with a digit and the others the game is on reach it. Only where the browser has it (Chromium) and only in full screen, which is where a browser grants it; elsewhere nothing changes

Members ​

constructor ​

ts
constructor(client: KeysHost);

Constructs a new instance of the KeyboardLock class

codes ​

ts
codes(): string[];

The keys asked for, by where they are (KeyboardEvent.code): Esc, and every key an action is on

dispose ​

ts
dispose(): void;

Lets go of the keyboard lock and its listeners

enabled ​

ts
get enabled(): boolean;

set enabled(on: boolean);

Whether it asks for the keys in full screen: yes unless the game says otherwise (GameView.input.lockKeys, or in code)

locked ​

ts
readonly locked: Accessor<boolean>;

Whether the keys are asked for now. A signal

refresh ​

ts
refresh(): void;

Asks for the keys, or gives them back, as full screen and enabled say: again after the keys changed