-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Questions & comments about the spec #2
Comments
LayersAbsolutely, I want a way to control layers. Functions I want available (atm):
How about something like this initially? Layer Control.
Layer Id Width
LEDsYeah, LEDs get complicated. KLL supports a wide number of addressing schemes as well as multiple channel widths on the same keyboard (say a few single color leds and RGB for different pixels).
|
Layer controlWhat should happen if a keyboard implements only a part of the layer stuff? Like, if it does not support Latch? (for example, Kaleidoscope implements it in a plugin, and as such, it is completely optional; QMK allows to turn it off too, though it has it enabled by default) Perhaps the firmware could respond with a NACK, indicating it does not support that action? And then the host-side can do something with that information. As for layer width: 8 bits should be enough, indeed, but the layer id width command sounds good for future proofing! LEDsYeah, different commands for the different addressing modes sound reasonable. I'd still suggest a "LED mode" command too - selecting from a pre-defined set of effects is an addressing mode too, if you squint a little. ;) Device Id👍 |
Relying on the host set layers and LEDs on a keyboard directly has always seemed really cumbersome to me. That forces you to have host-side code which has to be on every computer you want to use the keyboard with. Why not have the host share data with the keyboard such as the current application, and let the keyboard do whatever it wants? |
@eltang Yeah, for KLL I'm definitely going to have that as an option :D |
Space reasons. The atmega32u4 boards I work with, code that does stuff based on the application is often too much to fit into the available space, even if a lot of things are moved to EEPROM, space can easily be an issue. (On both my ErgoDox EZ, and on the Keyboardio Model01, my own keymap is near the limits.) Having an id that sends the application from the host side would be awesome, for boards that have the resources to implement that. For others, the layer switching ids require significantly less space. For hid-io to work, one will have to have a host-side application anyway, so I do not see much harm making that application smarter, instead of pushing everything onto the keyboard. Mind you, I share the sentiment of not wanting too much logic on the host-side... if we could push everything onto the keyboard, that would rock, but there are limited resources on the keyboard. |
Where can one find the spec? |
Hi!
I've read through the spec fully, finally, and have a few observations about it, and a question or two. I'll start with the questions, those are easier.
Questions
Layers
Are there any plans to have a layer switching command? Where the host can tell the keyboard to turn various layers on? (Or ask it for the active layers)
This would be incredibly useful, because the host-side daemon could monitor the active application, and tell the keyboard to switch layers depending on which window is in focus.
If I could make a suggestion, I'd propose something like this:
We'd have a
layer-on
and alayer-off
command, to make things easier. It would return the list of active layers in both cases. To get the list of active layers without changing anything, a command without payload could be sent (and both thelayer-on
andlayer-off
commands would give the same response in this case).LEDs
It would be great if it would be possible to control the LEDs from the host. The problem here is that there are many ways keyboards can use LEDs: status LEDs, single-color backlight, RGB backlight strip, per-key RGB LEDs, and so on. So to keep things simple, I'd think that a command to set the "LED mode" would be the best. The keyboard can decide what those modes can do.
Though, if the host could have more control over the LEDs, that would be grand. But I'm not sure how to approach that yet.
Observations
There are a few commands in the spec which I think are... problematic to implement properly, and where a different solution may be better.
0x12
keyboard layoutI'm not sure I follow what this is supposed to do... to allow displaying the active layout? But then, what about keys that do not have an USB code? Like layer switching keys, macros, and so on?
0x13
button layout &0x14
keycap shapesThis is something that I believe would be better implemented outside of the keyboard. For one, this information would be a big static blob for most keyboards, that would just take up space, and would be the same for all builds. Instead, we could have a hardware database shipped with the daemon, and that could look up the same info based on device IDs and such.
To give an example, the Keyboardio Model 01 has custom sculpted keycaps, all 64 keys are different. If I understand the intent of this command, it would allow the host to draw a keyboard, with proper keycap sizes and such. This would work for keyboards that use standard keycaps, but would utterfly fail for those that use custom ones. Or if they have a non-standard physical layout.
I'd just push this task onto the host, and a hardware database instead. Takes less space in the firmware, and allows much more flexibility, and a more precise description.
The text was updated successfully, but these errors were encountered: