With so many existing keyboard, why would I want to spend more time on it? I only need to set it up once and forget, right?
First it's for fun. Recently I'm very into keyboards and macropods. I just purchased 3 keyboards and 2 macropods. And one of the reasons I'm typing this is I want to use my new keyboard.
Second it's for personal learning. Recently I'm also working on various embedded projects. This would have been a great opportunity to have my hands dirty.
Third, let's talk about some practical usages. Like many other people, I don't want to install the official software which is believed to be malware. I try the custom solution from rOzzy87, it's not really working for me. Maybe it's because my Surface Pro 3 being old. And a macropad, by nature requires customization. So how can I configure it? I need a highly customizable firmware.
The custom firmware by biemster is good, but doesn't support advanced features like tap dance, layer etc. It does support LED and EEPROM for storage. The fak firmware has rich features and very generic. However it doesn't support the macropad I own. I'd like to combine these 2 projects and create my own firmware.
Beyond that, it'd be very cool and feature complete to have VIA support. So the macropad can be re-configured in a web browser. If that's possible, it'd be the golden firmware for the macropad for most people. It will still be limited by the VIA. You can't really define tap dance, combos in it. It has to be done via the firmware.
Current Progress
So far I've created my own firmware with fak.
Keyboard with tap dance, layer and combo enabled
Key 1 - single tap for selecting world, double tap for select all
Key 2 - single tap for copy and double tap for copy all
Key 3 - single for pates and double paste all
Knob counterclockwise - undo
Knob clockwise - redo
Knob - single tap for Play/Pause, double for next song, triple for previous song
All 4 keys combo - bootloader
Key 1 + key 2, layer 1 for Windows flavor
Key 1 + key 3, layer 2 for macOS flavor
LEDs are lit up. Fak itself doesn't support LED, I used the implementation from biemster, original from wagiminator, to light up the LEDs.
It took me quite a while to catch a configuration difference. biemster uses 16MHz, and with Fak my macropad is running at 24MHz.
EEPROM for keymap storage is not really worth it without VIA support. It's required by VIA.
VIA integration
VIA integration is halted. I spent some time tried to understand the protocol and integration it with fak. The good thing is that I'm able to understand the protocol basics.
It requires these components
Read from and write to EEPROM for customized keymap and other configurations.
Handle HID events sent from the VIA user app. These events are either read current configurations or set new configurations.
Callbacks for customizations.
To suport VIA in Fak, I replaced some functions calls with fak equivalent. I still need to insert the VIA event handler in the fak's USB main loop in usb.c. It's a total new area that I haven't get a chance to dig in.