Support for Alternative Layouts
This is a summary of how alternative layouts have been supported by kits such as Colevrak and Homing. It is not a discussion of alt layout performance and development, but if that interests you I highly recommend starting with Pascal Getreuer’s A guide to alt keyboard layouts (why, how, which one?). It’s a concise and comprehensive overview with links to some great sites that go deeper. He also has a separate Links about keyboards page. The Keyboard layouts doc he recommends explains layout goals and metrics in detail, summarizing the alt layouts discussed here as well as more than one hundred others. Sculpted-profile The majority of custom keycap sets are sculpted-profile (Cherry, SA, MT3, KAT, etc. - more on profiles generally here) so let’s start there. Because each row has a unique keycap shape, alt layouts require a unique keycap for each legend that moves off its QWERTY row. At first there were two The Dvorak layout was patented in 1936 by August Dvorak & William L....
Apr 23, 2024
Some suggestions however: 1. Add a way to rearrange layers (important) 2. Add a way to remove custom colors 3. Color the default color options accordingly so it's easier to visualize 4. Add a way to download generated sources instead of the compiled binary 5. Add a way to export and import configuration presets 6. Add a way to remove created presets 7. Add a way to select multiple LEDs using a rectangle selection 8. Write up some documentation 9. Maybe encode the hard-coded default LED layer options in the configurator instead of this being a separate thing, which is confusing 10. Add "transparent" LED option (similar to how the layer system works), so only select LEDs are changed from lower layers 11. Add the three missing special keys (n-key rollover toggle etc.) 12. The 3 inner edge LEDs on the right side are vertically inverted: https://i.imgur.com/UEvNHdP.png as you can see I had to invert the order of the colors here to make it actually match the left side after flashing
EDIT: I figured out the bug in the configurator: if you attempt to set a LED on a layer above a layer that you didn't attempt to set a LED on previously (let's say you have LEDs on layer 3, create layer 4 and 5 and then attempt to set LEDs on layer 5 directly) the configurator crashes.
I'd also like to add "set default brightness". Doesn't need to be for all schemes, just so I'm not blinded when I reset my board.
https://github.com/Massdrop/qmk_firmware/commit/d8936f343525d68eac632e075bc2ca4a6633100d
and
https://github.com/Massdrop/qmk_firmware/commit/5fb9b454811c6440ec0e8ad2758f5a3fc8a679ea
respectively.
Edit: Okay, you inspired me, I pulled down that fork un-commented that block and compiled. It did not work. 2 bugs (super easy to fix, I'm sure will be fixed before merged into QMK proper) . Here's the result:
The F1 and F3 cycle through colors, and 1 changes colors if you fn+d/fn+a. I'd post a video, but if anybody is curious, you'd be better off just building it yourself (worth 100 videos).
Bugs in question are on lines
https://github.com/Massdrop/qmk_firmware/blob/master/keyboards/massdrop/ctrl/keymaps/default/keymap.c#L209 and https://github.com/Massdrop/qmk_firmware/blob/master/keyboards/massdrop/ctrl/keymaps/default/keymap.c#L213 respectively (change .id to .id0, I'm guessing. I have no idea what id's map to which keys 🤷♂️)
https://github.com/Massdrop/qmk_firmware/blob/master/keyboards/massdrop/ctrl/config_led.h
According to the comment, the IDs should match with the LED labels on the back of the PCB which can be found by taking off the back plate of the keyboard.
I knew buying 2 of these would come in handy 😉
I'll dig around and see what I can find.
(I might try to make a chart or spreadsheet or something if I can make any definitive progress)
Done that two weeks ago.
Here's what I spent my afternoon on. After I finally figured out what those magic numbers meant, I made something to help me along.
https://docs.google.com/spreadsheets/d/1kiBfnmMFix5_T1oD7WCBvGF-wOoa0wvOVLMAP4B00jI/edit?usp=sharing
Using that and the stubbed out code from above, I was able to completely recreate what I did via the Web Configurator.
(So basically it was the perfect mechanical keyboard project. Lots of time and effort spent for something that's already been done 😉)
(I screwed up my repo or I'd just push up my work from this afternoon, and it would become pretty clear)
Firstly, you'll need to make sure you're working against MD's fork of QMK, and the file we'll want to look at is
https://github.com/Massdrop/qmk_firmware/blob/master/keyboards/massdrop/ctrl/keymaps/default/keymap.c#L209
Like lets say I want All of my keys to be blue, the glow to be orangi-sh, but the escape key to be purple. Using my sheet, I know that the code for all of the letter keys is
.id0 = 4294967295, .id1 = 4294967295, .id2 = 16777215
however, I don't want to the "escape key" in there. Again, using my sheet, I know that it's value is 2 and it's in array id0, so the line of code that will give you the blue letters will be (4294967295 - 2 = 4294967293)
{ .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 4294967293, .id1 = 4294967295, .id2 = 16777215, .r = 0, .g = 201, .b = 255 },
The orange underglow will be { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id2 = 4278190080, .id3 = 1073741823, .r = 255, .g = 187, .b = 0 },
Now, for the purple.
We know from the sheet, escape's value is 2, in id0, so it's code will look like
{ .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 2, .r = 197, .g = 9, .b = 213 },
So putting it all together: { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 4294967295, .id1 = 4294967295, .id2 = 16777215, .r = 0, .g = 201, .b = 255 }, { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id2 = 4278190080, .id3 = 1073741823, .r = 255, .g = 187, .b = 0 }, { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 2, .r = 197, .g = 9, .b = 213 },
There's still a lot more things I still haven't figured out, such as all of the features you can do with the mapping, but that was about all my 🧠 could handle today.
(I'm guessing you know that r, g, b = rbg right? You can just use a Hex to rgb converter online for colors. There's like a zillion of them. I don't want to be patronizing 😅)
https://github.com/Massdrop/qmk_firmware/blob/master/keyboards/massdrop/ctrl/keymaps/default/keymap.c#L212
You can see there's a `.layer` attribute passed in there (although in that example it's used with patterns and what not, but the important part is `.layer = X`)
I did this { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id0 = 2, .layer = 1, .r = 197, .g = 9, .b = 213 }, for when I press the fn key! Neat effect I thought.
https://github.com/Massdrop/qmk_firmware/blob/master/keyboards/massdrop/ctrl/keymaps/default/keymap.c#L205-L215
Just keep the commented lines commented out, and put your own stuff in! the `{ .end = 1 }` is important though! 👨🏫
https://github.com/LastContinue/qmk_firmware/blob/massdrop/keyboards/massdrop/ctrl/keymaps/lastcontinue/keymap.c#L217
I've only scratched the surface of QMK, but it's fun to play around with!
I got started probably a year ago (on a kit keyboard), and even since then, the installation of the toolchain needed to compile and load code has gotten much better. *
(for Mac users. If you're on Windows, I have no idea how that even works)
I used { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_PATTERN, .id0 = 65536, .pattern_id = 2 } to give my "pause" key the rainbow scroll effect (Rainbow Scroll is set as the 3rd item in my list, so [2] in my led_programs.c) 🌈
You can use { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN, .id0 = X, .id1 = Y}, To make those keys act like the "default" (original firmware) way of only using the patterns defined in led_programs.c, so you can use fn+a, fn+d to change patterns. 😄
(again, I hope I'm not patronizing you, Good luck with the rest of your exploring)