Skip to content
  1. API
  2. Ogma

Ogma.keyboard

Keyboard API: functions to listen to keyboard events.

ogma.keyboard.isKeyPressed(key)

Indicates if the specified key is pressed.

Arguments

Returns

  • boolean

ogma.keyboard.resetKeys()

Resets the stored values for the keys that the user has pressed. Useful to ensure that after a certain shortcut the next combination will be detected properly, even if the user made a mistake. Also use it in the browsers which do not report loss of focus when a dialog window is open.