2022-09-30 10:07:34 +08:00
|
|
|
import { KeyboardOptions, PhysicalKeyboardParams } from "../interfaces";
|
|
|
|
/**
|
|
|
|
* Physical Keyboard Service
|
|
|
|
*/
|
|
|
|
declare class PhysicalKeyboard {
|
|
|
|
getOptions: () => KeyboardOptions;
|
|
|
|
dispatch: any;
|
|
|
|
/**
|
|
|
|
* Creates an instance of the PhysicalKeyboard service
|
|
|
|
*/
|
|
|
|
constructor({ dispatch, getOptions }: PhysicalKeyboardParams);
|
2023-01-19 08:51:34 +08:00
|
|
|
handleHighlightKeyDown(e: KeyboardEvent): void;
|
|
|
|
handleHighlightKeyUp(e: KeyboardEvent): void;
|
2022-09-30 10:07:34 +08:00
|
|
|
/**
|
|
|
|
* Transforms a KeyboardEvent's "key.code" string into a simple-keyboard layout format
|
2023-01-19 08:51:34 +08:00
|
|
|
* @param {object} e The KeyboardEvent
|
2022-09-30 10:07:34 +08:00
|
|
|
*/
|
2023-01-19 08:51:34 +08:00
|
|
|
getSimpleKeyboardLayoutKey(e: KeyboardEvent): string;
|
2022-09-30 10:07:34 +08:00
|
|
|
/**
|
|
|
|
* Retrieve key from keyCode
|
|
|
|
*/
|
2023-01-19 08:51:34 +08:00
|
|
|
keyCodeToKey(keyCode: number): string;
|
2024-03-05 09:45:41 +08:00
|
|
|
isModifierKey: (e: KeyboardEvent) => boolean;
|
2022-09-30 10:07:34 +08:00
|
|
|
}
|
|
|
|
export default PhysicalKeyboard;
|