Moves the LED control code, along with the built-in effects into the
Keyboardio-LEDControl plugin.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This is a slightly tweaked version of LEDControl from core
KeyboardioFirmware, along with the built-in LED effects.
The one major change is that LED sync is now called just before the update,
instead of at the end of the main loop. This, however, should not be a
noticeable change.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
When a key interrupts the one-shot, mask the position out until a key release.
This is needed, because even a short tap usually results in a short hold, which
in turn - without the mask - handles the key.
Instead, we now mask the position out until it is released, so no such problems
arise. Fixes#4.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
I forgot to update the `LCTRL`, `LALT`, etc macros, and they still assumed the
previous order. This little patch fixes that.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
We want to treat the one-shot keys as active even when they were interrupted -
as long as their state is not cleared. This is because when using isActive from
another plugin, or macro, that is usually in response to a key press that
already sets up `shouldCancel` - yet, the modifier is technically active still!
So `isActive` does not check the to-be-cancelled flag anymore. This makes the
Escape-OneShot plugin much more reliable as a consequence.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Useful when writing an event handler that needs to check if a modifier is
active, but may run before OneShot has a chance to re-register the given
modifier.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
When another one-shot key is pressed, reset the timer, and handle it as if
starting anew, but without cancelling any previous one-shots. This allows one to
chain one-shots together.
Fixes#3.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
With the swap, using `raw` becomes more straightforward, because the flags will
occupy the higher bits, and the keyCode the lower ones. This makes range checks
much more intuitive.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
The text of the GPL-2 in LICENSE was old, had the old FSF address, and referred
to the LGPL as the "Library GPL" (it's been "Lesser GPL" for a while now). This
simply updates the text with the latest text of the GPL-2. Apart from
formatting, the FSF address change, and the Library->Lesser GPL, there are no
other changes.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
There is no `libraries/` in the core firmware anymore, do not add that to the
library search path.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Apart from marking the `build` target as the default, and a custom
`astyle` target, everything else will just be dispatched further to
tools/keyboardio-builder.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
If there exists a configuration in the user's home directory, source it
too. Allows setting up some host-wide defaults.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
If there are no local libraries installed, do not add the directory to
the arduino-builder commandline.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Instead of cding all the time to the Sketch directory, remain where it
was, and work from there. This makes it possible to use relative paths
for the various tool paths.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Now supports everything that the old Makefile did, and a bit more. Some
cases still need to be handled, and documentation needs to be written,
but it is in a much better shape now.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
The tool - a work in progress - is meant to eventually replace the Makefile. It
is set up so that it can easily be reused by third-party libraries to build
their own examples, with minimal amount of configuration.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
These were moved to their own repos, and are now included in
keyboardio-libraries, which in turn is included in Arduino-Boards. As such,
remove the libraries from the core firmware.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This is the same Keyboardio-MouseKeys that lived in core KeyboardioFirmware up
until this point. It has been lifted out, the same GPL-2 license file added,
along with a README, and the URL in library.properties has been updated.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This is the same plugin that was in KeyboardioFirmware before, with a README,
and a license file attached, and the URL corrected in library.properties.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
For some delays, the holding was not long enough, or it never triggered. Do that
independently of the other cases, in a separate branch, instead of chaining it
into an else branch.
This makes the example work as desired.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Only turn the LED off if it was on before. Otherwise we will turn off those too
that were not in the map yet.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Instead of relying on the active effect to turn the LED off, do so
ourselves at the end.
Fixes#1.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
The macro needs to check `.keyCode` and `.flags` separately, due to byte
ordering. If it does not, it will easily catch other things.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>