We fill the cached `keyMap` with the value of `DefaultLayer`, so if that is the
only layer active, then we can bail out early.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Instead of going through all the active layers each time we are looking for a
key, whenever we switch layers, compute the effective keymap, and store the
indexes. This makes the lookup a considerably faster operation, and lookups
happen far more often than layer switching.
This comes at a cost of ROWS*COLS amount of memory, and a bit of code, but on
the flip side, the lookup operation is now O(1), which is a very nice property
to have, if you want responsiveness. Changing layers is marginally slower,
however, but even with 32 active layers, doing the computation once, instead of
potentially many dozens of time, is still worth it.
We could further reduce the memory requirements if we stored more columns per
byte, but that's for a future optimization.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Renamed the library to Kaleidoscope-LED-ActiveModColor, and followed up with
other renames.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Renamed the library to Kaleidoscope-LEDEffect-SolidColor, and followed up with
other renames.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Renamed the library to Kaleidoscope-GhostInTheFirmware, and followed up with
other renames.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Not all keyboard hardware has per-key LEDs, and not all of them define the LED_*
helpers. To make the LEDControl at least compile for these, guard the
BootAnimation with a Model01-specific ifdef.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
The build-all command needs a clean(-ish) slate, and must re-set the build-dir,
otherwise a successful build of a previous plugin will remove it. As a
workaround, re-launch the builder in this case.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Instead of counting loops for the purpose of calculating acceleration, use
timers and steps instead. This means that we can now tune how often the mouse
moves (`speedDelay`), how much it moves when it does (`speed`), how fast
acceleration is (`accelSpeed`), and how often we accelerate (`accelDelay`).
By default, the movement speed is one, and there is no delay, while acceleration
has an 50ms delay, and a speed of one.
But all of these can be tuned at run-time: we can turn off acceleration
completely, or slow down the mouse considerably - the possibilities are almost
endless!
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
As loop counters are not a reliable substitute for timers, because they are
unreliable, use proper timers instead.
Fixes#3.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>