#cp.commands.shortcut
Shortcut Commands
#Submodules
#API Overview
Functions - API calls offered directly by the extension
Fields - Variables which can only be accessed from an object returned by a constructor
Methods - API calls which can only be made on an object returned by a constructor
#API Documentation
#Functions
Signature | cp.commands.shortcut.build(receiverFn) -> cp.commands.shortcut.builder |
Type | Function |
Description | Creates a new shortcut builder. |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | src/extensions/cp/commands/shortcut.lua line 69 |
Signature | cp.commands.shortcut.new(modifiers, keyCode) -> shortcut |
Type | Function |
Description | Creates a new keyboard shortcut, attached to the specified hs.commands.command |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/commands/shortcut.lua line 51 |
#Fields
Signature | cp.commands.shortcut:isEnabled <cp.prop: boolean> |
Type | Field |
Description | If true , the shortcut is enabled. |
Notes | None |
Source | src/extensions/cp/commands/shortcut.lua line 124 |
#Methods
Signature | cp.commands.shortcut:bind(pressedFn, releasedFn, repeatedFn) -> shortcut |
Type | Method |
Description | This function binds the shortcut to a hotkey, with the specified callback functions for pressedFn , releasedFn and repeatedFn . |
Parameters |
|
Returns |
|
Notes |
|
Examples | None |
Source | src/extensions/cp/commands/shortcut.lua line 169 |
Signature | cp.commands.shortcut:delete() -> shortcut |
Type | Method |
Description | Deletes a shortcut. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/commands/shortcut.lua line 231 |
Signature | cp.commands.shortcut:disable() -> shortcut |
Type | Method |
Description | This disables the shortcut. If a hotkey has been bound, it will be disabled also. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/commands/shortcut.lua line 155 |
Signature | cp.commands.shortcut:enable() -> shortcut |
Type | Method |
Description | This enables the shortcut. If a hotkey has been bound, it will be enabled also. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/commands/shortcut.lua line 141 |
Signature | cp.commands.shortcut:getKeyCode() -> string |
Type | Method |
Description | Returns a string containing the keycode of the shortcut. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/commands/shortcut.lua line 111 |
Signature | cp.commands.shortcut:getModifiers() -> table |
Type | Method |
Description | Returns a table containing the modifiers for a shortcut. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/commands/shortcut.lua line 98 |
Signature | cp.commands.shortcut:trigger([app]) -> shortcut |
Type | Method |
Description | This will trigger the keystroke specified in the shortcut. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/commands/shortcut.lua line 244 |
Signature | cp.commands.shortcut:unbind() -> shortcut |
Type | Method |
Description | Unbinds a shortcut. |
Parameters |
|
Returns |
|
Notes | None |
Examples | None |
Source | src/extensions/cp/commands/shortcut.lua line 212 |