cp.commands.command.isActive <cp.prop: boolean; read-only>
cp.commands.command.isEnabled <cp.prop: boolean>
true
, the command is enabled.cp.commands.command:action(getFn, setFn) -> command
getFn
function should have no arguments.setFn
function can have two optional arguments:clear
- A boolean that defines whether or not the value should be cleared.completionFn
- An optional completion function callback.cp.commands.command:activated(repeats) -> command
repeats
- the number of times to repeat the 'repeated' function. Defaults to 1.cp.commands.command:activatedBy([modifiers,] [keyCode]) -> command/modifier
modifiers
- (optional) The table containing names of required modifiers.keyCode
- (optional) The key code that will activate the command, with no modifiers.command
if a keyCode
was provided, or modifier
if not.cp.commands.command:addShortcut(newShortcut) -> command
newShortcut
- the shortcut to add.self
cp.commands.command:deleteShortcuts() -> command
cp.commands.command:disable() -> cp.commands.command
cp.commands.command
instance.cp.commands.command:enable() -> cp.commands.command
cp.commands.command
instance.cp.commands.command:getAction() -> function, function
cp.commands.command:getFirstShortcut() -> command
nil
if none have been registered.nil
.cp.commands.command:getGroup() -> string
cp.commands.command:getImage() -> hs.image object
nil
if not is specified.cp.commands.command:getShortcuts() -> command
cp.commands.command:getSubtitle() -> string
nil
.cp.commands.command:getTitle() -> string
cp.commands.command:groupedBy(group) -> cp.commands.command
group
- The group ID.cp.commands.command
instance.cp.commands.command:hasAction() -> boolean
true
if action callbacks have been assigned, otherwise false
.cp.commands.command:id() -> string
cp.commands.command:image(img) -> cp.commands.command
cp.commands.command
instance.img
- The hs.image
to use.cp.commands.command
instance.cp.commands.command.new() -> command
id
- the unique identifier for the command. E.g. 'cpCustomCommand'parent
- The parent group.cp.commands.command:parent() -> cp.commands
cp.commands.command:pressed() -> command
nil
if none is present.cp.commands.command:released() -> command
nil
if none is present.cp.commands.command:repeated(repeats) -> command
repeats
- the number of times to repeat. Defaults to 1.cp.commands.command:setShortcuts(shortcuts) -> command
cp.commands.shortcuts
to apply to this command.cp.commands.command
instance.cp.commands.command:subtitled(subtitle) -> cp.commands.command
cp.commands.command
instance.subtitle
- The new subtitle.cp.commands.command
instance.cp.commands.command:titled(title) -> command
cp.commands.command:whenActivated(activatedFn) -> command
activatedFn
- the function to call when activated.cp.commands.command:whenPressed(pressedFn) -> command
pressedFn
- the function to call when pressed.cp.commands.command:whenReleased(releasedFn) -> command
releasedFn
- the function to call when released.cp.commands.command:whenRepeated(repeatedFn) -> command
repeatedFn
- the function to call when repeated.