omega-game-engine
    Preparing search index...

    Class Keybord

    A static class for managing keyboard input state.

    • It tracks the pressed, down, and up states of each key.
    Index

    Constructors

    Properties

    keyDown: { [key: string]: boolean } = {}

    A map that stores which keys are currently held down.

    keyPress: { [key: string]: boolean } = {}

    A map that stores which keys were pressed in the last frame.

    keyUp: { [key: string]: boolean } = {}

    A map that stores which keys were released in the last frame.

    Methods

    • Checks if a key is currently held down.

      Parameters

      • key: string

        The key to check (e.g., 'w', 'a', 'shift'). Case-insensitive.

      Returns boolean

      True if the key is down, false otherwise.

    • Checks if a key was pressed down in the current frame.

      Parameters

      • key: string

        The key to check. Case-insensitive.

      Returns boolean

      True if the key was pressed, false otherwise.

    • Checks if a key was released in the current frame.

      Parameters

      • key: string

        The key to check. Case-insensitive.

      Returns boolean

      True if the key was released, false otherwise.