Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "wed/key"

Index

Classes

Type aliases

Variables

Functions

Type aliases

TriValued

TriValued: boolean | EITHER_

Variables

Const EITHER

EITHER: EITHER_ = new EITHER_()

Value meaning "either true or false", by opposition to true and false.

Const NULL_KEY

NULL_KEY: Key = Key.make(-1, false, -1)

This is a Key that cannot match anything.

Let id

id: number = 0

Functions

makeCtrlEqKey

  • makeCtrlEqKey(ch: string | number, shiftKey?: TriValued): Key
  • This function creates a key object which represents a "control equivalent" character. A "control equivalent" is equivalent to a control key on all platforms, except in OS X where it is equivalent to a command key. That is if one makes a "control equivalent" with the character "X", then on all platforms it would be equivalent to hitting Ctrl-X, except in OS X where it is equivalent to hitting Command-X.

    Parameters

    • ch: string | number

      This parameter can be a string of length one which contains the character for which we want to create a Key. If a number, it is the character code of the key.

    • Default value shiftKey: TriValued = EITHER

      Whether this is a [...]-Shift sequence or not.

    Returns Key

    The key created.

makeCtrlKey

  • makeCtrlKey(ch: string | number, shiftKey?: TriValued): Key
  • This function creates a key object which represents a control character (a character typed while Ctrl is held).

    Parameters

    • ch: string | number

      This parameter can be a string of length one which contains the character for which we want to create a Key. If a number, it is the character code of the key.

    • Default value shiftKey: TriValued = EITHER

      Whether this is a Ctrl-Shift sequence or not.

    Returns Key

    The key created.

makeKey

  • makeKey(which: string | number, keypress?: boolean, keyCode?: undefined | number, charCode?: undefined | number, ctrlKey?: boolean, altKey?: boolean, metaKey?: boolean, shiftKey?: TriValued): Key
  • This function creates a key object.

    throws

    {Error} If which is not a single character string or a number.

    Parameters

    • which: string | number

      This parameter can be a string of length one which contains the character for which we want to create a Key. If a number, it is the character code of the key.

    • Default value keypress: boolean = true

      Whether this key is meant to be used for keypress events rather than keyup and keydown.

    • Optional keyCode: undefined | number

      The key code of the key.

    • Optional charCode: undefined | number

      The character code of the key.

    • Default value ctrlKey: boolean = false

      Whether this key requires the Ctrl key held.

    • Default value altKey: boolean = false

      Whether this key requires the Alt key held.

    • Default value metaKey: boolean = false

      Whether this key requires the meta key held.

    • Default value shiftKey: TriValued = EITHER

      Whether this key requires the shift key held. It is invalid to use this parameter if keypress is true.

    Returns Key

    The key created.

makeMetaKey

  • makeMetaKey(ch: string | number, shiftKey?: TriValued): Key
  • This function creates a key object which represents a meta character (a character typed while Meta is held).

    Parameters

    • ch: string | number

      This parameter can be a string of length one which contains the character for which we want to create a Key. If a number, it is the character code of the key.

    • Default value shiftKey: TriValued = EITHER

      Whether this is a Meta-Shift sequence or not.

    Returns Key

    The key created.

Generated using TypeDoc