geekhack
geekhack Community => Ergonomics => Topic started by: LordHiler on Thu, 23 May 2019, 07:57:43
-
Hello all! This is my first post here. I am building my first Ergodox Infinity and I am going to be soldering in the 3mm flangless single-color LEDs that the PCB and Cherry MX switches support. I have already programmed a four layer keymap using the Input Club configurator. However, while it allows you to change the brightness of all of the LEDs together, I cannot find any way to set the LEDs on or off per-switch or per-layer. I read the documentation from IC on the built in LED control and it looks like this should be possible, but I admit I'm starting to get out of my depth. If it's a matter of making specific changes to code in specific files I can do that, but I will need fairly specific instructions. I've tried searching this and other forums, the support forum for Kono, and just about anywhere else I could think to look and couldn't find anything.
My general goal is to have only the active keys lit when I change layers. I'm willing to specific whether an LED for a given key should be on and off individually for each key, for each layer, I just need to know how to do that, or if it is truly possible. Hopefully some of you have some experience/insight into programming LEDs!
Thank you so much for your help! I'm really excited about this build.
-
As a follow-up, I dug into the MDErgo1-Default-0.kll and found the following:
U"FUNCTION5" : ledControl( 0, 15 );
U"FUNCTION4" : ledControl( 1, 15 );
These correspond to my assignments to the left hand function keys 4 and 5 respectively, to make the LED backlighting brighter (U"FUNCTION4") and darker (U"FUNCTION5"). I don't know enough about the code to know whether the resulting information eg: ledControl( 0, 15); actually provides any useful insight into how to program more complicated LED controls. Complete ignorance. But lets take a more generic key for example.
U"ESC" : U"6";
Can I add to the code to tell it how to control a specific LED as well? Again, not a coder and apologize for my ignorance, but could I do something like this:
U"ESC" : U"6" : ledControl(0);
In this pretend scenario I imagine that ledControl(0) means on and ledControl(1) would mean off, and that this command would only control the LED attached to that switch. Obviously there are a lot of broad and unfounded guesses here, just hoping somebody has some insight lol.
Edit: I found code that looks like it relates to the LED controller in the following files
Left_kiibohd.dfu.bin
left_kiibohd.secure.dfu.bin
right_kiibohd.dfu.bin
right_kiibohd.secure.dfu.bin
Unfortunately I'm having a lot of trouble reading the files as the fonts are not displaying properly. I'm at work and don't have privileges to install something like Notepad++ which would hopefully make it easier. I will try to check that out later. Meanwhile I have attached those files in case anyone is willing to look at them and see what they see.
Thanks!
Edit: I pulled the JSON code for a single switch, in case that helps at all. You can see the different values for the different layers, is there a way to also trigger the LED per layer per switch using this code? Thanks.
{
"code": "0x0C",
"x": 22,
"y": 6,
"w": 4,
"h": 4,
"layers": {
"0": {
"key": "Y",
"label": "Y"
},
"1": {
"key": "#:None",
"label": "NONE"
},
"2": {
"key": "#:None",
"label": "NONE"
},
"3": {
"key": "T",
"label": "T"
}
}
},
Edit Again:
I promise I'll stop after this. At the very bottom of that same JSON file I see the following code, which looks promising
],
"leds": [
],
"custom": {
},
"animations": {
"all_on": {
"settings": "start, pfunc:interp",
"frames": [
"P[c:0%](255), P[c:100%](255)"
]
}
}
}