Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IKeyboardLayout

An object which represents an abstract keyboard layout.

Hierarchy

  • IKeyboardLayout

Implemented by

Index

Properties

Methods

Properties

name

name: string

The human readable name of the layout.

This value is used primarily for display and debugging purposes.

Methods

isValidKey

  • isValidKey(key: string): boolean
  • Test whether the given key is a valid value for the layout.

    Parameters

    • key: string

      The user provided key to test for validity.

    Returns boolean

    true if the key is valid, false otherwise.

keyForKeydownEvent

  • keyForKeydownEvent(event: KeyboardEvent): string
  • Get the key for a 'keydown' event.

    Parameters

    • event: KeyboardEvent

      The event object for a 'keydown' event.

    Returns string

    The associated key value, or an empty string if the event does not represent a valid primary key.

keys

  • keys(): string[]
  • Get an array of all key values supported by the layout.

    Returns string[]

    A new array of the supported key values.

    Notes

    This can be useful for authoring tools and debugging, when it's necessary to know which keys are available for shortcut use.

Generated using TypeDoc