Have you ever found yourself typing git commit -m "fixed stuff" for the eighteenth time in one hour, questioning every life decision that brought you to this moment? Or maybe youâre playing a game and constantly reaching across the desk to hit a convoluted keybind that makes your wrist sound like a bowl of Rice Krispies. Weâve all been there. You spend 12 hours debugging spaghetti code, and by the end of it, your pinky finger is staging a violent rebellion against your control key.
What if you could just⌠hit one big, satisfying, clicky button to do the hard work for you?
Welcome to Project 47, where we embrace peak laziness and build a custom Macro Keyboard. No more memorizing shortcuts. No more cramped hands. Just glorious, tactile mechanical switches that instantly run whatever command you want. Itâs time to fire up the soldering iron, hopefully without releasing the magic blue smoke, and build something actually useful.

To make a computer recognize our DIY contraption as an actual keyboard, we canât use our standard Uno. We need a board that supports native USB HID (Human Interface Device). Enter the ATmega32U4.

For a full-sized keyboard, you have to wire switches into a complex matrix using diodes to prevent âghosting.â But for a small 4-to-6 key macropad? Weâre keeping it dead simple.
We will wire one leg of each mechanical switch to a dedicated digital pin on the Pro Micro, and the other leg directly to Ground. Weâll use the Arduinoâs internal pull-up resistors (just like we learned in Digital Inputs) to read when a button is pressed. When the switch is pushed, the pin reads LOW, and we tell the computer we just pressed a keyboard shortcut.
Here is the boilerplate to get a 3-key macro pad up and running. Youâll need the built-in Keyboard.h library.
#include <Keyboard.h>
// Define our pins
const int button1 = 2;
const int button2 = 3;
const int button3 = 4;
void setup() {
// Initialize buttons with internal pull-ups
pinMode(button1, INPUT_PULLUP);
pinMode(button2, INPUT_PULLUP);
pinMode(button3, INPUT_PULLUP);
Keyboard.begin();
}
void loop() {
// Button 1: Copy (CTRL + C)
if (digitalRead(button1) == LOW) {
Keyboard.press(KEY_LEFT_CTRL);
Keyboard.press('c');
delay(100);
Keyboard.releaseAll();
delay(300); // Debounce
}
// Button 2: Paste (CTRL + V)
if (digitalRead(button2) == LOW) {
Keyboard.press(KEY_LEFT_CTRL);
Keyboard.press('v');
delay(100);
Keyboard.releaseAll();
delay(300);
}
// Button 3: Git Commit Macro
if (digitalRead(button3) == LOW) {
Keyboard.print("git commit -m \"fixed things\"");
Keyboard.write(KEY_RETURN);
delay(300);
}
}
Thatâs it! Now go forth and automate your life, one clicky button at a time.