API Reference
Namespaces
Classes
Events
Global
Externals

Class: Keystroke

CIQ.UI. Keystroke


new Keystroke( [cb] [, params])

UI Helper for capturing and handling keystrokes. cb to capture the key.

Developer is responsible for calling e.preventDefault() and/or e.stopPropagation();

Parameters:
Name Type Argument Description
cb function <optional>

Callback when key pressed

params object <optional>
Properties
Name Type Argument Description
keysToRepeat array <optional>

Keys to process multiple times if key is held down

node HTMLElement <optional>

Node to indicate the document to add keystroke to

Since:
  • 8.5.0 Added node parameter.

Members


noKeyCapture :Boolean

Set this to true to bypass key capture. Shift, CTRL, CMD will still be toggled however.

Type:
  • Boolean

Methods


keypress(e)

Identifies a keypress event.

Parameters:
Name Type Description
e KeyboardEvent

mapKey(key)

Map command key values from keyboard to their internal values.

Note: ctrl and cmd should only be used with care as they may conflict with browser and OS hotkeys.

Parameters:
Name Type Description
key string
Returns:
Type
string