contro-max
Version:
Game controls done in the best possible way!
20 lines (19 loc) • 517 B
TypeScript
import { AllKeyCodes } from './types/keyCodes';
interface Options {
/** whether to fire `e.preventDefault()`. Usefull for cancelling actions by browser Ex. `CTRL+S`
* @default true
*/
preventDefault?: boolean;
caseSensitive?: boolean;
}
/**
* @example
* ```ts
* const isPressed = useKeyPressed('KeyZ')
* ```
*/
export declare const useKeyPressed: (key: AllKeyCodes, options?: Options) => boolean;
export declare const usePointerLockActive: () => {
pointerLocked: boolean;
};
export {};