ahtn / keyplus

An easy to use, wired and wireless modular keyboard firmware
MIT License
246 stars 40 forks source link

Extend modkeys to support both left and right modifiers #10

Open ahtn opened 7 years ago

ahtn commented 7 years ago

The current implementation of modkeys only supports left or right modifiers but not both.

To allow both kinds of modifiers at once, we would need to use extended keycodes (EKC). An extended keycode for modkeys would look like this:

[0x00] -> KC_MODKEY
[0x02] -> 8-bit modifier mask
[0x03] -> 8-bit HID keycode

And the modkey handler would need to be extended appropriately.

Since modkeys account for the majority off key presses when typing, I'd like to build this implementation on top of the current one, as using EKC's have a little bit of extra overhead in terms of code size and speed.