UPDATE: I realized that my difficulty with the hotkey macros (particularly when trying to set up "Temporarily Unmute" in Zoom or "Scroll Down" in Chrome) lay in a fundamental misunderstanding of how to use the HID keycodes. After a week of banging my head against the wall, success. When I get a second, I'll do the Github thing, but meanwhile, for any Mac users, here are the latest versions of my macro configs for Zoom, Slack, Spotify (desktop app) and Chrome.
Zoom:
Code: Select all
# MACROPAD Hotkeys: Zoom for Mac
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
app = { # REQUIRED dict, must be named 'app'
"name": "Zoom", # Application name
"macros": [ # List of button macros...
# COLOR LABEL KEY SEQUENCE
# 1st row ----------
(0x000000, "Mute", [Keycode.COMMAND, Keycode.SHIFT, "A"]), # Mute/Unmute
(0x000000, "Record", [Keycode.SHIFT, Keycode.COMMAND, "R"]), # Local Record
(0x000000, "TempUM", [Keycode.SPACE]), # Temporarily Unmute
# 2nd row ----------
(0x000000, "Video", [Keycode.SHIFT, Keycode.COMMAND, "V"]), # Start/Stop Video
(0x000000, "AltCam", [Keycode.SHIFT, Keycode.COMMAND, "N"]), # Switch Camera
(0x000000, "Share", [Keycode.SHIFT, Keycode.COMMAND, "S"]), # Screen Sharing
# 3rd row ----------
(0x000000, "FullSc", [Keycode.SHIFT, Keycode.COMMAND, "F"]), # Full Screen
(0x000000, "Control", [Keycode.CONTROL, Keycode.OPTION, Keycode.COMMAND, "H"]),
(0x000000, "Gallery", [Keycode.SHIFT, Keycode.COMMAND, "W"]), # View
# 4th row ----------
# Encoder button ---
(0x000000, "", [Keycode.COMMAND, "W"]), # Close Current Window
],
}
Slack (note: emoji kotkey not yet functional):
Code: Select all
# MACROPAD Hotkeys: Slack for Mac
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
app = { # REQUIRED dict, must be named 'app'
"name": "Slack", # Application name
"macros": [ # List of button macros...
# COLOR LABEL KEY SEQUENCE
# 1st row ----------
(0x202000, 'Unread', [Keycode.SHIFT, Keycode.COMMAND, 'a']), # Unreads
(0x202000, 'Reply', [Keycode.COMMAND, 'g']), # Search
(0x202000, 'Emoji', 'r'), # Emoji Reaction
# 2nd row ----------
(0x202000, 'New', [Keycode.COMMAND, 'n']), # New Message
(0x202000, 'Edit', [Keycode.COMMAND, 'e']), # Edit Message
(0x202000, '+File', [Keycode.COMMAND, 'u']), # Add File
# 3rd row ----------
(0x202000, 'Mute', 'm'), # Mute
(0x202000, 'Video', 'v'), # Video Toggle
(0x202000, 'Invite', 'a'), # Invite List
# 4th row ----------
(0x202000, 'WS1', [Keycode.COMMAND, '1']), # 1st Workspace in List
(0x202000, 'WS2', [Keycode.COMMAND, '2']), # 2nd Workspace in List
(0x202000, 'Prefs', [Keycode.COMMAND, ',']), # Preferences
# Encoder button ---
],
}
Spotify:
Code: Select all
# MACROPAD Hotkeys: Spotify for Mac
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
app = { # REQUIRED dict, must be named 'app'
"name": "Spotify", # Application name
"macros": [ # List of button macros...
# COLOR LABEL KEY SEQUENCE
# 1st row ----------
(0x004000, "Play", [Keycode.SPACE]), # Play
(0x004000, "Back", [Keycode.COMMAND, Keycode.LEFT_ARROW]), # Previous Track
(0x004000, "Next", [Keycode.COMMAND, Keycode.RIGHT_ARROW]), # Next Track
# 2nd row ----------
(0x004000, "Vol +", [Keycode.COMMAND, Keycode.UP_ARROW]), # Volume Up
(0x004000, "Vol -", [Keycode.COMMAND, Keycode.DOWN_ARROW]), # Volume Down
(0x004000, "Min", [Keycode.COMMAND, "m"]), # Minimize
# 3rd row ----------
# 4th row ----------
# Encoder button ---
(0x000000, "", [Keycode.COMMAND, "w"]), # Close Current Window
],
}
# Write your code here :-)
Chrome:
Code: Select all
# MACROPAD Hotkeys: Chrome for Mac
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
app = { # REQUIRED dict, must be named 'app'
"name": "Chrome", # Application name
"macros": [ # List of button macros...
# COLOR LABEL KEY SEQUENCE
# 1st row ----------
(0x000040, "< Back", [Keycode.COMMAND, "["]),
(0x000040, "Reload", [Keycode.COMMAND, "R"]),
(0x000040, "+Tab", [Keycode.COMMAND, "T"]), # New tab
# 2nd row ----------
(0x000040, "Copy", [Keycode.COMMAND, "C"]),
(0x000040, "Paste", [Keycode.COMMAND, Keycode.SHIFT, Keycode.OPTION, "V"]),
(0x000040, "Down", [Keycode.SPACE]), # Scroll down
# 3rd row ----------
(0x000040, "+Zoom", [Keycode.COMMAND, "+"]),
(0x000040, "-Zoom", [Keycode.COMMAND, "-"]),
(0x000040, "Incog", [Keycode.SHIFT, Keycode.COMMAND, "N"]),
# 4th row ----------
(
0x000040,
"Ada",
[Keycode.COMMAND, "n", -Keycode.COMMAND, "www.adafruit.com\n"],
), # Adafruit in new window
(
0x000040,
"BGG",
[Keycode.COMMAND, "n", -Keycode.COMMAND, "www.boardgamegeek.com\n"],
), # BGG in new window
(
0x000040,
"Hacks",
[Keycode.COMMAND, "n", -Keycode.COMMAND, "www.hackaday.com\n"],
), # Hack-a-Day in new win
# Encoder button ---
(0x000000, "", [Keycode.COMMAND, "w"]), # Close window/tab
],
}