Make qmk config changes painless

A while back, I got into the custom keyboard game. It use Arduino Pro Micro as the controller powered by qmk firmware.

This is very potent combination, that allows all manner of customization. Some of the interesting ones are:

Tap Dance

Hit the semicolon key once, send a semicolon. Hit it twice, rapidly – send a colon. Hit it three times, and your keyboard’s LEDs do a wild dance…

MIDI sequencer

This turns it into a MIDI controller, if you don’t know what that is, check out this guys video.

To configure this system, you have a very handy Web GUI, That will give you a .hex file that can be uploaded by QMK ToolBox, a Desktop App. This is a very quick 2 min procedure, normally.

My case however, is a bit more advanced use-case. I wanted the ability of modifying the source code and compile those changes along with keymap changes. This is something the above workflow doesn’t do, as it doesn’t allow uploading custom firmware up. It uses the latest master branch from the github repo as the base for compiling the .hex.

This means I have to do the following steps to get my keyboard layout changed,

  1. Download the layout json file
  2. convert it to keymap.c using qmk json2c
  3. Copy it into a specific directory in the local qmk repo
  4. Add your custom code to keymap.c
  5. Run qmk compile
  6. Open QMK Toolbox
  7. Press Flash
  8. Press Reset on the board
  9. Connect the other side of split keyboard, and remove the current one.
  10. Repeat steps 6 & 7
  11. Change back the connection.

This is to be repeated for even a single key change… Which is supremely annoying when you want to attain that sweet spot.

After doing this for 12 times, I have all the revisions of the layout, I was fed up and created the below script. This one changes the above flow to.

  1. Download the layout json file
  2. Run script
  3. Press Reset on the board
  4. Connect the other side of split keyboard, and remove the current one.
  5. Repeat steps 6 & 7
  6. Change back the connection.

Which is awesome. Your welcome.

P.S. The custom code should be kept in keymap-pre.h in the same dir as keymap.c

Related Posts

Leave a Reply

%d bloggers like this: