The MacroPad by Adafruit is a poor man’s StreamDeck; consisting of a 3x4 keypad, a rotary encoder knob (with button) and an OLED display. Making it a great piece of hardware that can be made to be quite useful.

HotKeys

To quickly make it useful there is an existing project MacroPad HotKeys that you can grab to quickly setup HotKeys. Allowing you to config specific buttons to combinations of keyboard actions. The rotary encoder provides you with 20 different menus that you can config each of the 12 keys and the press of the rotary knob as well.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# MACROPAD Hotkeys example/template: Text Injection

from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values

app = {
    'name' : 'Injection', # Application name
    'macros' : [          # List of button macros...
        # COLOR(RGB) LABEL  KEY SEQUENCE
        # 1st row ----------
        (0x220000, 'first', '<yourFirstName>'),
        (0x220000, 'surname', '<yourSurname>'),
        (0x220000, 'full', '<yourFullName>'),
        # 2nd row ----------
        (0x000000, 'exIp', '1.1.1.1'), 
        (0x220000, 'Ip6WL', '1:1:1:1::/64'), 
        (0x000000, 'inIp', '192.168.1.1'),
        # 3rd row ----------
        (0x000000, '@...', '<emailAddress>'),  
        (0x220000, '@...', '<emailAddress>'),   
        (0x000000, '@work', '<emailAddress>'), 
        # 4th row ----------
        (0x220000, '', ''),
        (0x220000, '#-pre', '<phoneNumber'),   
        (0x220000, '#full', '+<prefix><phoneNumber>'), 
        # Encoder button ---
        (0x000000, 'QL', [Keycode.ALT, 'Q'])

gist: injector.py

To let go a key, prefix it with -

e.g. [Keycode.ALT, Keycode.F12, -Keycode.ALT, 'fvm flutter gen-l10n', Keycode.ENTER]

Introduce a delay to your Keycode sequency be adding the duration in seconds

e.g. [Keycode.A, 0.5, Keycode.B, 1.0, Keycode.C]

I’ve found I use it for 2 use cases:

  1. For commands I don’t use much or can never remember
    e.g. running a projects code generation task fvm flutter pub pub run build_runner build --delete-conflicting-outputs
  2. For text expansion / injection where I want the pleasure of just pushing 1 key to make it happen instead or having to use a complex shortcut key combination, such as: inserting your email address, fullname, or fill out a form of fields when testing an app

Other Projects