McTibetimWeb - v0.1.0
    Preparing search index...

    Bridges key events with the active keyboard layout.

    KeyHandler owns a single Layout instance and delegates all key-handling and key-name queries to it. The active layout can be changed at runtime via selectLayoutById.

    Index

    Constructors

    Methods

    • Returns the display names for all keys in the given modifier state.

      Parameters

      • shift: boolean

        Whether the Shift modifier is active.

      • ctrl: boolean

        Whether the Control modifier is active.

      • alt: boolean

        Whether the Alt modifier is active.

      Returns Map<string, string>

      A map from key character to its display name.

    • Handles a key event within the given state.

      Parameters

      • key: Key

        The key to handle.

      • state: InputState

        The current input state.

      • stateCallback: (state: InputState) => void

        Called with the new state when a transition occurs.

      • errorCallback: () => void

        Called when an unrecoverable input error is detected.

      Returns boolean

      true if the key was consumed by the layout.

    • Switches the active layout to the one identified by id.

      If no layout with the given id is registered, the current layout is kept.

      Parameters

      • id: string

        The layout identifier (e.g. 'sambhota_keymap_one').

      Returns void