Skip to content

Commit d83d646

Browse files
Merge pull request #1664 from emceeaich/main
Add Firefox Linux and Numpads to Macropad examples
2 parents d1f7491 + 632619c commit d83d646

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# MACROPAD Hotkeys example: Firefox web browser for Linux
2+
3+
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
4+
5+
app = { # REQUIRED dict, must be named 'app'
6+
'name' : 'Linux Firefox', # Application name
7+
'macros' : [ # List of button macros...
8+
# COLOR LABEL KEY SEQUENCE
9+
# 1st row ----------
10+
(0x004000, '< Back', [Keycode.CONTROL, '[']),
11+
(0x004000, 'Fwd >', [Keycode.CONTROL, ']']),
12+
(0x400000, 'Up', [Keycode.SHIFT, ' ']), # Scroll up
13+
# 2nd row ----------
14+
(0x202000, '< Tab', [Keycode.CONTROL, Keycode.SHIFT, Keycode.TAB]),
15+
(0x202000, 'Tab >', [Keycode.CONTROL, Keycode.TAB]),
16+
(0x400000, 'Down', ' '), # Scroll down
17+
# 3rd row ----------
18+
(0x000040, 'Reload', [Keycode.CONTROL, 'r']),
19+
(0x000040, 'Home', [Keycode.CONTROL, 'h']),
20+
(0x000040, 'Private', [Keycode.CONTROL, Keycode.SHIFT, 'p']),
21+
# 4th row ----------
22+
(0x101010, 'Ada', [Keycode.CONTROL, 't', -Keycode.CONTROL,
23+
'www.adafruit.com\n']), # adafruit.com in a new tab
24+
(0x000040, 'Dev Mode', [Keycode.F12]), # dev mode
25+
(0x101010, 'Digi', [Keycode.CONTROL, 't', -Keycode.CONTROL,
26+
'digikey.com\n']), # digikey in a new tab
27+
# Encoder button ---
28+
(0x000000, '', [Keycode.CONTROL, 'w']) # Close window/tab
29+
]
30+
}

Macropad_Hotkeys/macros/numpad.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# MACROPAD Hotkeys example: Universal Numpad
2+
3+
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
4+
5+
app = { # REQUIRED dict, must be named 'app'
6+
'name' : 'Numpad', # Application name
7+
'macros' : [ # List of button macros...
8+
# COLOR LABEL KEY SEQUENCE
9+
# 1st row ----------
10+
(0x202000, '7', ['7']),
11+
(0x202000, '8', ['8']),
12+
(0x202000, '9', ['9']),
13+
# 2nd row ----------
14+
(0x202000, '4', ['4']),
15+
(0x202000, '5', ['5']),
16+
(0x202000, '6', ['6']),
17+
# 3rd row ----------
18+
(0x202000, '1', ['1']),
19+
(0x202000, '2', ['2']),
20+
(0x202000, '3', ['3']),
21+
# 4th row ----------
22+
(0x101010, '*', ['*']),
23+
(0x800000, '0', ['0']),
24+
(0x101010, '#', ['#']),
25+
# Encoder button ---
26+
(0x000000, '', [Keycode.BACKSPACE])
27+
]
28+
}

0 commit comments

Comments
 (0)