Zebra API Doc

zebra.ui.KeyEvent Class

Input key event class. The input event is triggered by a keyboard and has UID property set to zebra.ui.InputEvent.KEY_UID value

Constructor

zebra.ui.KeyEvent

(
  • target
  • id
  • code
  • ch
  • mask
)

Parameters:

  • target zebra.ui.Panel

    a source of the key input event

  • id Integer

    an unique ID of the key input event: zebra.ui.KeyEvent.PRESSED, zebra.ui.KeyEvent.TYPED, zebra.ui.KeyEvent.RELEASED

  • code Integer

    a code of pressed key

  • ch String

    a character of typed key

  • mask Integer

    a bits mask of pressed meta keys: zebra.ui.KeyEvent.M_CTRL, zebra.ui.KeyEvent.M_SHIFT, zebra.ui.KeyEvent.M_ALT, zebra.ui.KeyEvent.M_CMD

Methods

isAltPressed

() Boolean

Test if ALT key is held


Return: Boolean

true if ALT key is held

isCmdPressed

() Boolean

Test if command (windows) key is held


Return: Boolean

true if command key is held

isControlPressed

() Boolean

Test if CTRL key is held


Return: Boolean

true if CTRL key is held

isShiftPressed

() Boolean

Test if SHIFT key is held


Return: Boolean

true if SHIFT key is held

Attributes

ch

String readonly

A character of a typed key

code

Integer readonly

A code of a pressed key

ID

Integer readonly

Inherited from zebra.ui.InputEvent:

Unique id of the input event

mask

Integer readonly

A bits mask of pressed meta keys (CTRL, ALT, etc)

source

zebra.ui.Panel readonly

Inherited from zebra.ui.InputEvent:

Source of the input event

UID

Integer readonly

Inherited from zebra.ui.InputEvent:

Class id of the input event. It helps to differentiates input events by a device it has been generated