UNPKG

@polyzone/core

Version:
52 lines (51 loc) 1.32 kB
import { IModule } from './IModule'; export declare enum InputButton { 'L1' = "L1", 'L2' = "L2", 'L3' = "L3", 'R1' = "R1", 'R2' = "R2", 'R3' = "R3", 'Up' = "Up", 'Down' = "Down", 'Left' = "Left", 'Right' = "Right", 'A' = "A", 'B' = "B", 'X' = "X", 'Y' = "Y", 'Start' = "Start", 'Select' = "Select" } export declare enum InputAxis { Left = "Left", Right = "Right" } export interface NativeInputManager { /** * Test whether `button` is currently pressed. * @param button The button to test */ isButtonPressed(button: InputButton): boolean; } declare class InputModule implements IModule { private manager; private currentInputState; private lastFrameInputState; onInit(): void; onUpdate(_deltaTime: number): void; /** * Test whether `button` was pressed in the most recent frame. * @param button The button to test */ wasButtonPressed(button: InputButton): boolean; /** * Test whether `button` was released in the most recent frame. * @param button The button to test */ wasButtonReleased(button: InputButton): boolean; isButtonPressed(button: InputButton): boolean; private getCurrentKeyboardState; } export declare const Input: InputModule; export {};