So far, the code is able to deserialize and apply a single layer, as saved by
the Agent in binary format. It does not support macros and keymap switching
yet (it parses the latter, but will choke on the former), but the rest should be
handled fine.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Since keyboard_layout.[ch] has gained more features, and handles more than just
filling out the keyboard report, move it to action.[ch] instead. I see no sane
way to separate the keyboard and mouse report filling, unless we want to loop
over key states twice, hence them being in the same file.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This implements the mouse action handling. There is no acceleration while
holding the mouse movement keys yet, though, that will be a separate step.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Due to a copy & paste error, Mod+d was doing Shift+Tab instead of Alt+Tab, this
fixes that.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This sets up the `Mouse` layer to have all the keys in their right place, even
if they do nothing for now. A number of enums were introduced to make it easier
to describe mouse key behaviour.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Adds `Fn` and `Mouse` layers, so the switcher keys actually work. Also
rearranged `Mod` to follow the factory layout, with the added change that
`Shift` keys are also included on the layer. The `Fn` layer was laid out,
according to the factory layout. The `Mouse` layer is mostly empty, except for
some modifiers and the switcher key.
The most significant difference from the factory layout is that modifiers are
present on all layers, in the same position.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Instead of passing the same constant to LedDisplay_SetLayerLed() all the time,
lift it out into a global.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
When switching layers, light up the appropriate LED on the display. For this
purpose, start led_display.[ch], which as a start, has a function to set the
brightness of a layer led.
The function will also turn all other LEDs off, and turn all of them off when on
the base layer.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
And while there, also drop the helper functions, and just do the activation in
the handler function. This simplifies the code a bit, as there is little point
in lifting out an assignment into a function at this time.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This does a lot of things - all of this together, because it would have been
much harder to split them up into many small commits.
We get rid of the helper macros used in default_layout.c, drop the .raw member
of uhk_key_t, use a singleton keymap, and prepare the prevKeyStates to handle
all slots. Also drops the TRNS macro.
With these changes, default_layout.h became obsolete, and was deleted too.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>