new KeystrokeHub( [node], context [, params])
UI Helper for capturing and handling keystrokes.
A helper or ContextTag can "claim" keystrokes and intercept them, otherwise the keystrokes will be handled by keyup and keydown events.
Parameters:
| Name | Type | Argument | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
node |
HTMLElement |
<optional> |
The node or selector to which to attach. Defaults to |
||||||||
context |
CIQ.UI.Context | The context for the chart |
|||||||||
params |
Object |
<optional> |
Parameters to drive the helper Properties
|
- Since:
-
5.1.0 Setting
nodeto anything other thandocumentallows keystrokes to be restricted by hover focus.
Methods
-
addHotKeyHandler(identifier, handler, stx)
-
Global method to add a hot key handler. Hot keys are defined in
hotkeyConfig.hotkeysin js/defaultConfiguration.js).Parameters:
Name Type Description identifierstring Name identifying the keystroke handler
handlerfunction Function to call when the hot key combination is pressed.
stxCIQ.ChartEngine A reference to the chart engine.
-
defaultHotKeys(key, hub, e)
-
Global default hotkey method. Pass this or your own method in to CIQ.UI.KeystrokeHub
Parameters:
Name Type Description keynumber The pressed key
hubCIQ.UI.KeystrokeHub The hub that processed the key
Properties
Name Type Description hotkeyConfigObject Hotkey settings options
hotkeysObject Specifies the default hotkeys
eKeyboardEvent The KeyboardEvent that triggered the function call
Returns:
Return true if you captured the key
- Type
- boolean
-
executeHotkeyCommand(params)
-
Default hotkey execution. Called from CIQ.UI.KeystrokeHub.defaultHotKeys.
Parameters:
Name Type Description paramsobject Properties
Name Type Argument Description stxCIQ.ChartEngine A reference to the chart engine.
actionstring The action to execute
optionsobject <optional>
Any options specified in the config
Returns:
Return true if command was executed, false if invalid command
- Type
- boolean
-
setActiveContext(context)
-
Change the active context for the hub, for instance when dealing with multiple charts.
Parameters:
Name Type Description contextCIQ.UI.Context The context
