Class finesse.shortcutkey.ShortcutKeyService
ShortcutKeyService allows components or gadgets to create
shortcut keys for any component or gadget related actions.
Defined in: finesse.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
This method allows you to get all the registered shortcut keys.
|
|
init()
This method initializes the ShortcutKeyService for the Container or the gadgets.
|
|
registerShortcutKey(keys)
This method is used to register the shortcut keys for the components or the gadgets
|
|
sendKeyupEvent(keyEvent)
If there is any custom iframe created by the gadget that is not controlled by Finesse,
the Finesse shortcut key framework cannot capture the keyup event from that custom iframe to execute the shortcut keys.
|
Method Detail
{Array}
getShorcutKeys()
This method allows you to get all the registered shortcut keys.
- Returns:
- {Array} array of objects
init()
This method initializes the ShortcutKeyService for the Container or the gadgets.
registerShortcutKey(keys)
This method is used to register the shortcut keys for the components or the gadgets
var arr = [ { "id": "cisco_callhandling_endCall" "componentName": "Call Control", "actionName": "End Call", "modifierKeys": "ctrlKey + shiftKey", "key": "e", "handler": function () {} }]; finesse.shortcutkey.ShortcutKeyService.registerShortcutKey(arr);
Shortcut Key registration payload details
Attribute | Type | Description | Required |
---|---|---|---|
id | String | A unique id generated by gadget. The pattern for this id can be companyName_gadgetId_operation. | Required |
componentName | String | Name of the functionality, component, or the gadget. | Required |
actionName | String | Name of the action or operation performed by the assigned shortcut keys. | Required |
key | String | Actual key combined with the modifier keys. For example, Ctrl + Shift + e where Ctrl and Shift are the modifiers keys and e is the actual key. | Required |
executionScope | ENUM |
|
Required |
modifierKeys | ENUM |
Keybaord modifier key combinations.
finesse.shortcutkey.ShortcutKeyService.CONSTANTS.MODIFIER_KEYS.*
| Optional |
callback | function | Callback function that is invoked when the shortcut keys are pressed. | Required |
- Parameters:
- keys
- - Array of keys object:
sendKeyupEvent(keyEvent)
If there is any custom iframe created by the gadget that is not controlled by Finesse,
the Finesse shortcut key framework cannot capture the keyup event from that custom iframe to execute the shortcut keys.
This method can be used to send the Keyup event object to the Finesse container.
The keyup event object has to be captured inside the child iFrame and propagated to its immediate parent.
The parent again has to propagate the event to its immediate parent until the event reaches the Finesse container.
Once the immediate parent is the Finesse container, then use sendKeyupEvent to propagate the event to Finesse container.
Param object has to be serializable and cannot contain any functions.
var keyEvent = { ctrlKey: event.ctrlKey, altKey: event.altKey, shiftKey: event.shiftKey, keyCode: event.keyCode, key: event.key }
- Parameters:
- keyEvent
- - Object