Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HotkeySystem

With a Hotkey System the runner can use hotkeys on their keyboard to control the Timer. The hotkeys are global, so the application doesn't need to be in focus. The behavior of the hotkeys depends on the platform and is stubbed out on platforms that don't support hotkeys. You can turn off a Hotkey System temporarily. By default the Hotkey System is activated.

Hierarchy

Index

Constructors

constructor

Properties

ptr

ptr: number

Methods

activate

  • activate(): boolean
  • Activates a previously deactivated Hotkey System. If it's already active, nothing happens.

    Returns boolean

config

deactivate

  • deactivate(): boolean
  • Deactivates the Hotkey System. No hotkeys will go through until it gets activated again. If it's already deactivated, nothing happens.

    Returns boolean

dispose

  • dispose(): void
  • Disposes the object, allowing it to clean up all of its memory. You need to call this for every object that you don't use anymore and hasn't already been disposed.

    Returns void

setConfig

  • Applies a new hotkey configuration to the Hotkey System. Each hotkey is changed to the one specified in the configuration. This operation may fail if you provide a hotkey configuration where a hotkey is used for multiple operations. Returns false if the operation failed.

    Parameters

    Returns boolean

with

  • Allows for scoped usage of the object. The object is guaranteed to get disposed once this function returns. You are free to dispose the object early yourself anywhere within the scope. The scope's return value gets carried to the outside of this function.

    Type parameters

    • T

    Parameters

    Returns T

Static new

  • Creates a new Hotkey System for a Timer with the default hotkeys.

    Parameters

    Returns HotkeySystem

Static withConfig

  • Creates a new Hotkey System for a Timer with a custom configuration for the hotkeys.

    Parameters

    Returns HotkeySystem

Generated using TypeDoc