You are browsing as a guest. Sign up (or log in) to start making projects!

James-Macropad

Hardware
  • 7 Devlogs
  • 14 Total hours

A hackpad following Hack Club's Macropad guide (my first PCB project)

Ship #1

I made a custom 3x4 layout macropad configured with 5 keyboard profiles! It also features a unique keylogging mechanism using a custom class KMK extension that places itself within the KMK firmware Display update loop to display to the user their inputs and key combinations.
Everything is my own design, including the PCB and 3d printed CAD parts. Made with parts from the hack club hackpad kit.

The keyboard profiles include:

  1. Default (includes commonly-used keys like HOME, END, arrow keys, and some Fn keys)
  2. Numpad (includes numbers)
  3. Art layer (includes common Krita hotkeys like B for brush, E for eraser, A, S, R, etc.), activated through the Toggle key
  4. Art-CTRL layer (includes common CTRL-related commands for Krita, including CTRL+A and CTRL+S), activated by holding the bottom-left modifier key on the Art layer
  5. Art-CTRL-SHIFT layer (includes common CTRL-SHIFT-related commands for Krita, including CTRL+SHIFT+A and CTRL+SHIFT+Z), activated by holding the bottom-left modifier key AND the key directly above it on the Art layer
  • 7 devlogs
  • 14h build
  • 5.00x multiplier
  • 69 Stardust
  • Hackpad
Video of Project → See source code →
Open comments for this post

5h 9m 12s logged

Final Devlog (build phase)

PCB soldering + Assembly

I’ve successfully soldered my PCB and assembled my parts using some 3d prints and the kit that arrived a while ago.
There was an issue with my design where 2 out of the 6 screws in my design ended up being redundant, but it still works as-is!


KMK fixes + added input display functionality

I tested the KMK code that I wrote earlier and due to several errors in the code, it didn’t work.

I refactored the code to fix the errors, and I also added additional functionality:

  1. Expanded the number of profiles (KMK layers) from 2 to 5
  2. Added modifier key-like functionality (e.g. Ctrl and Shift) using the said profiles
  3. Added a custom input display class for the OLED that logs the user’s keypresses and displays the following action!

Input display

The OLED screen features an input display that keylogs the user the key commands and combinations that they press.
Making it work was actually surprisingly hard. For one, KMK does not provide much built-in functionality to perform an action after a specific key is pressed. I decided to create my own custom class - OLEDManager - to manage the keyboard’s TextEntry’s. OLEDManager can be placed itself in the actual firmware loop of KMK by adding it to keyboard.modules - allowing it to activate after keys are pressed or after the matrix is scanned. However, this took a while for me to figure out - there was some boilerplate required that I only corrected after some trial and error.
Initially, the keylogging functionality didn’t work if multiple keys were pressed at once, as KMK did not store key press events in some sort of log. I made a workaround that tracked the keypresses by adding and removing them incrementally based on the keypress and keyrelease events. After that, I ran into the issue where some keys wouldn’t be logged at all, or would only show up on the display AFTER the keys were released. This took me a really long time to figure out, but any keys that aren’t associated with layer change keys (e.g. KC.MO and KC.TG) don’t prompt any KMK Display rerenders. I could not simply update the text property of the TextEntry objects, I had to actually force a rerender after every keypress in order for the logging functionality to perform as expected.

0
0
17
Open comments for this post

1h 52m 1s logged

Finished the basic frame of the macropad casing in Fusion! I still need to make holes for the screws + adjust some further details, but there is a frame!

The way I implemented the plateless mounting style is definitely a little weird. The top half of the case has plate “cutouts”, but there’s a little bit of clearance between the MX keyswitches and the “plate”. I hope this will give my plateless macropad a bit more support

0
0
9
Open comments for this post

1h 27m 51s logged

I completely redesigned the PCB (again) to fix an error where I forgot to leave the USB port hanging off the edge… haha.
I’ve also begun the process of designing a case for the PCB in Fusion.

0
0
11

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…