A fully programmable, custom-built mechanical shortcut keypad (MacroPad) designed to streamline workflows, trigger complex macros, and automate repetitive desktop tasks. This project integrates custom mechanical design (CAD), hardware prototyping, and low-latency embedded C++ firmware.
- Programmable Key Matrix: Utilizes an efficient matrix wiring design to maximize input counts while optimizing microcontroller GPIO pin usage.
- Low-Latency HID Interaction: Configured as a native USB HID (Human Interface Device), sending high-speed keystrokes, shortcuts, and complex multi-key macro strings instantly.
- Layer-Based Profiles: Supports multi-layer mapping (e.g., Layer 0 for media/OS navigation, Layer 1 for CAD/Development hotkeys) toggled seamlessly via modifier keys.
To keep the footprint minimal and the controller cost-effective, the key layout uses a matrix scanning technique using diodes to prevent ghosting (where pressing multiple keys simultaneously registers unintended inputs).
| Component | Technical Specification |
|---|---|
| Microcontroller | High-speed, USB-native board (e.g., Arduino Pro Micro / RP2040) |
| Switches | Mechanical linear/tactile switches with 19mm standard spacing |
| Diodes | 1N4148 fast-switching signal diodes for anti-ghosting matrix circuitry |
| Interface | Wired USB-C/Micro-USB interface with native hardware support |
The application layer is built in modern embedded C++ and revolves around a non-blocking debounce and scan loop to capture inputs at the millisecond scale.
- Row Strobe: Pulls a single row pin
LOWorHIGH. - Column Read: Checks all column pins to see if any circuit is completed by a key press.
- Debounce Filter: Implements a software-based interval filter (typically 5ms) to ignore the electrical noise caused by physical switch contacts bouncing upon impact.
- HID Transmission: Transmits the corresponding keycode array via the USB interface.
Column 0 Column 1
β β
Row 0 βββββΌβββ[Key]ββββββΌβββ[Key]
β βββββ€βΊβββββ βββββ€βΊββββ
β β
Row 1 βββββΌβββ[Key]ββββββΌβββ[Key]
β βββββ€βΊβββββ βββββ€βΊββββ