/** * the default target element for keyboard events (usually the window element in which the game is running) */ export declare const keyBoardEventTarget: null; export declare function initKeyboardEvent(): void; /** * return the key press status of the specified action * @param action - user defined corresponding action * @returns true if pressed * @example * if (me.input.isKeyPressed('left')) { * //do something * } * else if (me.input.isKeyPressed('right')) { * //do something else... * } * @category Input */ export declare function isKeyPressed(action: string): boolean; /** * return the key status of the specified action * @param action - user defined corresponding action * @returns down (true) or up(false) * @category Input */ export declare function keyStatus(action: string): boolean; /** * trigger the specified key (simulated) event
* @param keyCode - (See {@link input.KEY}) * @param [status=false] - true to trigger a key down event, or false for key up event * @param [mouseButton] - the mouse button to trigger * @example * // trigger a key press * me.input.triggerKeyEvent(me.input.KEY.LEFT, true); * @category Input */ export declare function triggerKeyEvent(keyCode: number, status: boolean, mouseButton?: number): void; /** * associate a user defined action to a keycode * @param keyCode - (See {@link input.KEY}) * @param action - user defined corresponding action * @param [lock=false] - cancel the keypress event once read * @param [preventDefault=input.preventDefault] - prevent default browser action * @example * // enable the keyboard * me.input.bindKey(me.input.KEY.LEFT, "left"); * me.input.bindKey(me.input.KEY.RIGHT, "right"); * me.input.bindKey(me.input.KEY.X, "jump", true); * me.input.bindKey(me.input.KEY.F1, "options", true, true); */ export declare const bindKey: (keyCode: number, action: string, lock?: boolean, preventDefault?: boolean) => void; /** * return the action associated with the given keycode * @param keyCode - (See {@link input.KEY}) * @returns user defined associated action * @category Input */ export declare function getBindingKey(keyCode: number): string; /** * unlock a key manually * @param action - user defined corresponding action * @example * // Unlock jump when touching the ground * if (!this.falling && !this.jumping) { * me.input.unlockKey("jump"); * } * @category Input */ export declare function unlockKey(action: string): void; /** * unbind the defined keycode * @param keyCode - (See {@link input.KEY}) * @example * me.input.unbindKey(me.input.KEY.LEFT); * @category Input */ export declare function unbindKey(keyCode: number): void; //# sourceMappingURL=keyboard.d.ts.map