Options
All
  • Public
  • Public/Protected
  • All
Menu

The Keyboard aptitude provides access to the the ability to listen to hotkey, text and character.

Hierarchy

  • Keyboard

Index

Methods

  • listenCharacter(callback: (char: string) => void): Promise<Cancellable>
  • Calls callback function when a character is detected from the keyboard.

    Parameters

    • callback: (char: string) => void

      The callback function called when a character is detected from the keyboard.

        • (char: string): void
        • Parameters

          • char: string

          Returns void

    Returns Promise<Cancellable>

  • listenHotkey(hotkey: Hotkey, callback: (pressed: boolean) => void): Promise<Cancellable>
  • Calls callback function when the specified hotkey is pressed or released.

    Parameters

    • hotkey: Hotkey

      The hotkey to monitor to initiate callback.

    • callback: (pressed: boolean) => void

      The callback function called when the specified hotkey is pressed or released.

        • (pressed: boolean): void
        • Parameters

          • pressed: boolean

          Returns void

    Returns Promise<Cancellable>

  • listenText(callback: (text: string) => void, includeOliveHelpsEvents: boolean): Promise<Cancellable>
  • Calls callback function when text is detected from the keyboard.

    Parameters

    • callback: (text: string) => void

      The callback function called when text is detected from the keyboard.

        • (text: string): void
        • Parameters

          • text: string

          Returns void

    • includeOliveHelpsEvents: boolean

      if passed in true, callback will be called while olive helps window is in focus. Disabled by default.

    Returns Promise<Cancellable>

Generated using TypeDoc