# cp.commands.shortcut.builder

Shortcut Commands Builder Module.

# API Overview

Methods - API calls which can only be made on an object returned by a constructor

  • add
  • new

# API Documentation

# Methods

# add

Signature cp.commands.shortcut.builder:add(modifier, [keyCode]) -> shortcut/command
Type Method
Description Adds the specified modifier to the set. If a keyCode is provided, no more modifiers can be added and the original command is returned instead. Otherwise, self is returned and further modifiers can be added.
  • modifier - (optional) The modifier that was added.
  • keyCode - (optional) The key code being modified.
  • self if no keyCode is provided, or the original command.
Notes None
Examples None
Source src/extensions/cp/commands/shortcut.lua line 291

# new

Signature cp.commands.shortcut.builder.new([receiverFn]) -> builder
Type Method
Description Creates a new shortcut builder.
  • receiverFn - An optional function which will be called with the new shortcut, when built.
  • The builder instance
  • If provided, the receiver function will be called when the shortcut has been configured, and passed the new shortcut. The result of that function will be returned to the next stage.
  • If no receiverFn is provided, the shortcut will be returned directly.
Examples None
Source src/extensions/cp/commands/shortcut.lua line 269