DEV Community 👩‍💻👨‍💻

Cover image for I wanna hack my keyboard
Holy-Elie Scaïde
Holy-Elie Scaïde

Posted on

I wanna hack my keyboard

A while ago, I took the plunge and decided to buy a mechanical keyboard. I've settled on the Ducky One 2 Mini (I should have bought the TKL version). And I don't regret it (Except for the missing dedicated arrow keys). I don't even notice it when I type and the RGB lights can be mesmerizing when I'm thinking.

Last Saturday in the afternoon, I was updating the keyboard firmware when a thought struck me: Can I install custom firmware on it? I mean the default one is great, but I like to tinker with my devices at a lower level, not just with the options the manufacturer provided. I quickly searched on google to see if the firmware was open-sourced and unfortunately, it wasn't. But searching "ducky one 2 mini firmware" yielded promising results, particularly this post.

This was the first time I heard about the QMK project. It's a custom firmware for mechanical keyboards and has a bunch of cool features. I liked what I was reading in the documentation and I decided to give it a go.

I cloned the forked version of the guy (I still don't know his name) who worked on the version for Ducky and created a test branch. I first merged in the mbi5042gp branch which I think it's the driver interface to control the RGB lights. Then I merged in the duckyone2mini branch which contains the configuration for the keyboard.

The first build failed due to missing files in the lib/chibios-contrib folder. I recalled that this was a submodule and went in for the commit that may contain those missing files. Instead, I found a pull request made by the same guy (great work!). This pull request adds the missing files for the Microcontroller Unit included in the keyboard unit. So a quick git remote add, then a git checkout retrieved the needed files.

Another build failed, but that was due to some errors in the Makefiles and a constant's name (I should make a pull request for that). They were easy to fix and a final build generated the .hex file needed for the keyboard.

I would say that the QMK firmware was very enjoyable and that it was fun to use. But I did not flash the keyboard. It's the only one I have and it will be $100+ gone if I bricked it in the process. And I do not have the necessary tools to do a full recovery (JTAG anyone). So here I am with a compiled firmware and no courage to try it. But I learned a few things during the process and will learn more about the QMK project in the feature.

Top comments (3)

stupidhaiku profile image

Hi Holy-Elie!

This looks great! I happen to have a Ducky One 2 Mecha Mini that this might work on that's actually a spare right now. The arrow key and CTRL+arrow key functionality was insufficient for me (love the board, but this killed it for me), so I wound up buying a pok3r. Short version being, if you want me to test your CFW on a One 2 Mecha mini (should be pretty much identical to the One 2 mini) that won't be a big deal if it gets bricked, could you point me to the files you generated?

skydevht profile image
Holy-Elie Scaïde

unfortunately, I lost the files. I don't know how comfortable you are with C/C++ ecosystem, but it fairly easy to do so (only some git commands required) using this guide.
P.S. Let me add shamelessly that I'm in need of another keyboard for my home workspace (I go everywhere with mine (office, coworking space)), so if you're open to selling it with a price discount, I might buy it (depending on the discount). I have a friend in the US that can bring it to me, so that would work only if you're located in the US. (I can pay the local shipping fees)

stupidhaiku profile image

Too bad, was hoping to use it for a hackeyboard (that's my term, you can't have it! :P). I'd consider letting it go for half what I paid for it (it's got everything from the original box, mind, and was used for a day before I decided I couldn't handle the CTRL+FN behavior), but I'd want to make sure:

  1. You are ok with Cherry mx silent red switches, which this one has. Most people consider red switches "gaming" switches as they're linear, but I've come to love them for typing -- it feels like your fingers just brush over the keys and words appear. The board in question was my first silent red board though i have a regular red switch board, and the weight of the Mecha mini with the easy keypresses and light vibrations of the keys springing back made me fall in love with them. That's me, though, and everyone's different. So first I'd want to make sure that's the switch type you're after.
  2. You should be ok with the behavior of the CTRL+FN keys, which is what made me give it up (I otherwise love that board) as I haven't heard this described anywhere else. I use the CTRL + arrow keys all the time at work as it's a windows shop, and what made me frustrated about the One 2 mini was the fact that it considers CTRL+FN as a distinct layer for some reason. So if I want to navigate with the arrow keys, which is FN+ijkl, then it works fine; however, if I want to switch between arrow keys and CTRL+arrow keys (to move between words in windows) then I have to release the FN key, press CTRL first, then FN again, then ijkl. Having to do things in this order breaks my stride, and is different from the way traditional 60% boards handle this (which is to handle CTRL/FN being pressed together regardless of which was pressed first) and I eventually decided it wasn't worth the additional hassle. This behavior is actually what led me to your post, as I thought I could install a custom firmware to fix this.

In any case, if you're ok with the above I'm willing to sell it. I just wanted to make sure you were aware of the issues I had with it. Other than that, it's really a fantastic board (but then again, I'm a big Ducky fanboy). And yeah, I'm in the continental US. If any of the above gives you reservations, no worries, because I can try building the CFW using your instructions and let you know how it goes!

Stop sifting through your feed.

Find the content you want to see.

Change your feed algorithm by adjusting your experience level and give weights to the tags you follow.