rapid-render
    Preparing search index...

    Class InputManager

    Manages user input for keyboard and mouse events. Tracks key and button states, including pressed/released states for the current and previous frames.

    Index

    Constructors

    Methods

    • Removes all event listeners and cleans up resources.

      Returns void

    • Converts the mouse position to local coordinates relative to an entity.

      Parameters

      • entity: Entity

        The entity to convert coordinates for.

      Returns Vec2

      The mouse position in the entity's local coordinate system.

    • Checks if a mouse button is currently pressed (continuous detection).

      Parameters

      • button: number

        The mouse button number (0: left, 1: middle, 2: right).

      Returns boolean

      True if the button is pressed, false otherwise.

    • Checks if a mouse button is currently released.

      Parameters

      • button: number

        The mouse button number (0: left, 1: middle, 2: right).

      Returns boolean

      True if the button is released, false otherwise.

    • Checks if a key is currently pressed (continuous detection).

      Parameters

      • key: string

        The key code (e.g., "KeyW", "Space").

      Returns boolean

      True if the key is pressed, false otherwise.

    • Checks if a key is currently released.

      Parameters

      • key: string

        The key code (e.g., "KeyW", "Space").

      Returns boolean

      True if the key is released, false otherwise.

    • Updates the state of keys and buttons for the next frame.

      Returns void

    • Checks if a mouse button was pressed in the current frame (single trigger).

      Parameters

      • button: number

        The mouse button number (0: left, 1: middle, 2: right).

      Returns boolean

      True if the button was just pressed, false otherwise.

    • Checks if a mouse button was released in the current frame (single trigger).

      Parameters

      • button: number

        The mouse button number (0: left, 1: middle, 2: right).

      Returns boolean

      True if the button was just released, false otherwise.

    • Checks if a key was pressed in the current frame (single trigger).

      Parameters

      • key: string

        The key code (e.g., "KeyW", "Space").

      Returns boolean

      True if the key was just pressed, false otherwise.

    • Checks if a key was released in the current frame (single trigger).

      Parameters

      • key: string

        The key code (e.g., "KeyW", "Space").

      Returns boolean

      True if the key was just released, false otherwise.