docs » cp.commands.shortcut
Shortcut Commands
- Functions - API calls offered directly by the extension
- build
- new
- Fields - Variables which can only be accessed from an object returned by a constructor
- isEnabled
- Methods - API calls which can only be made on an object returned by a constructor
- bind
- delete
- disable
- enable
- getKeyCode
- getModifiers
- trigger
- unbind
| Signature | cp.commands.shortcut.build(receiverFn) -> cp.commands.shortcut.builder |
|---|---|
| Type | Function |
| Description | Creates a new shortcut builder. |
| Parameters |
|
| Returns |
|
| Notes |
|
| 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 |
|
| Signature | cp.commands.shortcut:isEnabled <cp.prop: boolean> |
|---|---|
| Type | Field |
| Description | If true, the shortcut is enabled. |
| 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 |
|
| Signature | cp.commands.shortcut:delete() -> shortcut |
|---|---|
| Type | Method |
| Description | Deletes a shortcut. |
| Parameters |
|
| Returns |
|
| 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 |
|
| 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 |
|
| Signature | cp.commands.shortcut:getKeyCode() -> string |
|---|---|
| Type | Method |
| Description | Returns a string containing the keycode of the shortcut. |
| Parameters |
|
| Returns |
|
| Signature | cp.commands.shortcut:getModifiers() -> table |
|---|---|
| Type | Method |
| Description | Returns a table containing the modifiers for a shortcut. |
| Parameters |
|
| Returns |
|
| Signature | cp.commands.shortcut:trigger() -> shortcut |
|---|---|
| Type | Method |
| Description | This will trigger the keystroke specified in the shortcut. |
| Parameters |
|
| Returns |
|
| Signature | cp.commands.shortcut:unbind() -> shortcut |
|---|---|
| Type | Method |
| Description | Unbinds a shortcut. |
| Parameters |
|
| Returns |
|