3
0
mirror of https://github.com/hodgef/simple-keyboard.git synced 2025-03-05 09:31:04 +08:00

26 lines
831 B
TypeScript
Raw Normal View History

2022-09-30 02:07:34 +00: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 00:51:34 +00:00
handleHighlightKeyDown(e: KeyboardEvent): void;
handleHighlightKeyUp(e: KeyboardEvent): void;
2022-09-30 02:07:34 +00:00
/**
* Transforms a KeyboardEvent's "key.code" string into a simple-keyboard layout format
2023-01-19 00:51:34 +00:00
* @param {object} e The KeyboardEvent
2022-09-30 02:07:34 +00:00
*/
2023-01-19 00:51:34 +00:00
getSimpleKeyboardLayoutKey(e: KeyboardEvent): string;
2022-09-30 02:07:34 +00:00
/**
* Retrieve key from keyCode
*/
2023-01-19 00:51:34 +00:00
keyCodeToKey(keyCode: number): string;
isMofifierKey: (e: KeyboardEvent) => boolean;
2022-09-30 02:07:34 +00:00
}
export default PhysicalKeyboard;