wilba / zeal60

Zeal60 Command Line Tool
38 stars 12 forks source link

Address brightness of individual keys #11

Open tylernm14 opened 6 years ago

tylernm14 commented 6 years ago

I have a couple of Rev3 Zeal60s and would like to set the individual brightness of certain keys so that they can shine through more brightly on translucent keys. Is it possible to set the brightness of individual keys? I know its not supported by V0.9 but I'm wondering if this is possible given the hardware? If you could point me in the direction of where this would be in the firmware I can have a look and possibly contribute back to the repo. Heard you are working on some GUI....?

wilba commented 6 years ago

Yes, each LED's RGB values are controlled, but I made the effects use HSV and a global brightness as this is easier to control and suits what most people would want (i.e. choosing a hue/saturation to match their case/keycaps).

I am not sure what you really need, as by default the global brightness is at maximum... you can't get it any brighter on some keys. However, you could do an override in some of the effects so that some LEDs use maximum brightness regardless of the global brightness setting, if that happens to be set lower. Look for references to g_config.brightness - this is the global brightness, set from the config tool and via Fn1+Fn2+ - / + keys.

tylernm14 commented 6 years ago

Great thanks for the hints. I have a submarine/naval theme where I'd like to have most keys a dull, subdued blue or aqua, and then I'd like to have one key bright red over which I have a keycap that is a translucent skull in a diving suit.

wilba commented 6 years ago

OK. Perhaps the easiest way to "hard code" this to your needs is to add code to the end of void backlight_effect_indicators(void). This function gets called after the backlight effect, to "override" some or all of the LED states to show layer state, caps lock state, etc. So you can add your custom "set one LED to be fully red" here. Then you can have it always be red, regardless of backlight effect or global brightness, i.e. use the existing functionality to get your dull blue, perhaps even set color1/2 to be two shades of blue and get some gradient effects that resemble water, idk...

To find the index of the LED you want to change, look at g_map_row_column_to_led as this matches the switch matrix row/col coordinates.