A.WidgetShortcut Class
Widget extension, which can be used to add shortcut support through the Base.build method.
Index
Methods
- _afterKeypress static
- _afterShortcutChange
- _setShortcut
- destructor
- initializer
- registerShortcut static
- unregisterShortcut static
Properties
- _shortcutItems static
Attributes
Events
Methods
_afterKeypress
-
event
Fired after the keypress
event.
Parameters:
-
event
EventFacade
_afterShortcutChange
()
protected
Fired after the shortcut
attribute is changed.
_setShortcut
-
val
Sets the shortcut
attribute.
Parameters:
-
val
Object
destructor
()
protected
Destructor implementation. Lifecycle.
initializer
()
protected
Construction logic executed during instantiation. Lifecycle.
registerShortcut
-
item
Starts listening for the item's shortcut.
Parameters:
-
item
Object
unregisterShortcut
-
item
Stops listening for the item's shortcut.
Parameters:
-
item
Object
Properties
_shortcutItems
Array
protected
static
Static property that holds the items that will be checked for the shortcuts that are pressed.
Attributes
shortcut
Boolean | Object
Shortcut information for this menu item. Should be an object with the
following keys: the text that should be used for the shortcut (using
the 'text' key), the list of keys that should be pressed (using the
'keys' key) and flags for each key modifier (the 'altKey', 'ctrKey',
'metaKey' and 'shiftKey' keys). For example:
{
keys: ['B'],
metaKey: true,
text: '⌘B'
}
In case there should be different shortcuts for different operating
systems, the shortcut
object should instead have a key per os with
the original shortcut information explainged above. The 'defaultShortcut' key
should be used to specify the same shortcut information for the operating
systems that weren't specified. An example of this usage:
{
macintosh: {
keys: ['B'],
metaKey: true,
text: '⌘B'
},
defaultShortcut: {
ctrlKey: true,
keys: ['B'],
text: 'Ctrl + B'
}
}
Default: false
Events
shortcut
Fired when a registered shortcut is activated.