shortcut

Shortcut Commands

Submodules

API Overview

API Documentation

Functions

build

Signature

cp.commands.shortcut.build(receiverFn) -> cp.commands.shortcut.builder

Type

Function

Description

Creates a new shortcut builder.

Parameters

Returns

Notes

new

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

Fields

isEnabled

Signature

cp.commands.shortcut:isEnabled <cp.prop: boolean>

Type

Field

Description

If true, the shortcut is enabled.

Methods

bind

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

delete

Signature

cp.commands.shortcut:delete() -> shortcut

Type

Method

Description

Deletes a shortcut.

Parameters

Returns

disable

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

enable

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

trigger

Signature

cp.commands.shortcut:trigger() -> shortcut

Type

Method

Description

This will trigger the keystroke specified in the shortcut.

Parameters

Returns

unbind

Signature

cp.commands.shortcut:unbind() -> shortcut

Type

Method

Description

Unbinds a shortcut.

Parameters

Returns