# cp.apple.commandeditor

Functions to control and manage Apple's Command Editor - used in Final Cut Pro, Motion and Compressor.


# API Overview

Constants - Useful values which cannot be changed

  • padKeys
  • supportedModifiers

Functions - API calls offered directly by the extension

  • characterStringToKeyCode
  • keypadCharacterToKeyCode
  • modifierMaskToModifiers
  • modifierMatch
  • shortcutsFromCommandSet
  • translateModifiers

# API Documentation

# Constants

# padKeys

Signature cp.apple.commandeditor.padKeys -> table
Type Constant
Description List of number keys on the number pad. Also mapped with the key name set to true for lookup purposes.
Notes None
Source src/extensions/cp/apple/commandeditor/init.lua line 25

# supportedModifiers

Signature cp.apple.commandeditor.supportedModifiers -> table
Type Constant
Description The list of supported modifiers
Notes None
Source src/extensions/cp/apple/commandeditor/init.lua line 35

# Functions

# characterStringToKeyCode

Signature cp.apple.commandeditor.characterStringToKeyCode() -> string
Type Function
Description Translate Keyboard Character Strings from Command Set Format into Hammerspoon Format.
Parameters
  • input - Character String
Returns
  • Keycode as String or ""
Notes None
Examples None
Source src/extensions/cp/apple/commandeditor/init.lua line 79

# keypadCharacterToKeyCode

Signature cp.apple.commandeditor.keypadCharacterToKeyCode() -> string
Type Function
Description Translate Keyboard Keypad Character Strings from Command Set Format into Hammerspoon Format.
Parameters
  • input - Character String
Returns
  • string or nil
Notes None
Examples None
Source src/extensions/cp/apple/commandeditor/init.lua line 93

# modifierMaskToModifiers

Signature cp.apple.commandeditor.modifierMaskToModifiers() -> table
Type Function
Description Translate Keyboard Modifiers from Apple's Property List Format into Hammerspoon Format.
Parameters
  • value - Modifiers String
Returns
  • A table of modifier strings.
Notes None
Examples None
Source src/extensions/cp/apple/commandeditor/init.lua line 155

# modifierMatch

Signature cp.apple.commandeditor.modifierMatch(inputA, inputB) -> boolean
Type Function
Description Compares two modifier tables.
Parameters
  • inputA - table of modifiers
  • inputB - table of modifiers
Returns
  • true if there's a match otherwise false
Notes
  • This function only takes into account 'ctrl', 'alt', 'cmd', 'shift'.
Examples None
Source src/extensions/cp/apple/commandeditor/init.lua line 128

# shortcutsFromCommandSet

Signature cp.apple.commandeditor.shortcutsFromCommandSet(id, commandSet) -> table
Type Function
Description Gets a specific command from a specified Command Set and returns a table of Shortcuts.
Parameters
  • id - The ID of the command you want to get.
  • commandSet - A table containing an entire Command Set.
Returns
  • A table of shortcuts for a specific command.
Notes None
Examples None
Source src/extensions/cp/apple/commandeditor/init.lua line 187

# translateModifiers

Signature cp.apple.commandeditor.translateModifiers() -> table
Type Function
Description Translate Keyboard Modifiers from Command Set Format into Hammerspoon Format.
Parameters
  • input - Modifiers String
Returns
  • table
Notes None
Examples None
Source src/extensions/cp/apple/commandeditor/init.lua line 110