Options
All
  • Public
  • Public/Protected
  • All
Menu

Contains a few utilities for parsing and working with different keyboard layout. Used by the Keyboard widget.

Index

Variables

Const controls

controls: Controls

Contains the character codes for the available control characters on the keyboard, such as space and return.

Const layouts

layouts: PresetLayouts

This object contains the keyboard layouts that are available for the keyboard widget. Each keyboard layout is a list with one entry for each keyboard row. Each row is a string that contains the characters available on that row.

Functions

createLayoutFromTemplate

  • createLayoutFromTemplate(template: string): string[]
  • Parses a custom template layout that was specified by the user. Rows are separated by commas, keys on a row may be separated by dashes.

    Parameters

    • template: string

      A custom layout template specified by the user.

    Returns string[]

    The parsed keyboard layout template. Contains one item for each row, each item contains the characters on that keyboard row.

getPresetControl

  • getPresetControl(name: string): string | undefined
  • Finds and returns the keycode for the given control character. You can use this keycode in a custom keyboard layout.

    Parameters

    • name: string

      string Name of the control keycode to get.

    Returns string | undefined

    The keycode with the given name, if it exists.

getPresetLayout

  • getPresetLayout(name: string): string | undefined
  • Finds and returns a built-in layout with the given name. Currently available layout are qwerty, qwertyBasic, and alphabetic.

    Parameters

    • name: string

      Name of a layout to get.

    Returns string | undefined

    The layout with the given name, if it exists.

isDefinedControl

  • isDefinedControl(key: string): boolean
  • Checks whether a built-in control with the given name exists. If it does, you can retrieve it via getPresetControl.

    Parameters

    • key: string

      string Name of the control keycode to check.

    Returns boolean

    true if a control for the given key is defined, false otherwise.

Generated using TypeDoc