Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HotkeyConfig

The configuration to use for a Hotkey System. It describes with keys to use as hotkeys for the different actions.

Hierarchy

Index

Constructors

constructor

Properties

ptr

ptr: number

Methods

asJson

  • asJson(): any
  • Encodes the hotkey configuration as JSON.

    Returns any

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

setValue

  • Sets a setting's value by its index to the given value.

    false is returned if a hotkey is already in use by a different action.

    This panics if the type of the value to be set is not compatible with the type of the setting's value. A panic can also occur if the index of the setting provided is out of bounds.

    Parameters

    Returns boolean

settingsDescriptionAsJson

  • settingsDescriptionAsJson(): any
  • Encodes generic description of the settings available for the hotkey configuration and their current values as JSON.

    Returns any

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 Configuration with default settings.

    Returns HotkeyConfig

Static parseFileHandle

  • Attempts to parse a hotkey configuration from a given file. null is returned it couldn't be parsed. This will not close the file descriptor / handle.

    Parameters

    • handle: number

    Returns HotkeyConfig

Static parseJson

  • Parses a hotkey configuration from the given JSON description. null is returned if it couldn't be parsed.

    Parameters

    • settings: any

    Returns HotkeyConfig

Generated using TypeDoc