The RxCx set of macros help addressing key positions within the keydata
the Scanner returns for us. These can be ORed together to form a pattern
to match against, for example, or to look for a certain key by address,
and so on.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Having the default handler in the list by default prevents other things
to hook up before it. Add it in Keyboardio_::setup instead, so that
others have a chance to add themselves first.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
It only causes trouble when trying to use the library from another one,
and for the KeyboardioFirmware, serves no useful purpose.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Do not hardcode the name of the tool that computes md5 sums, but make it
platform-dependent: on at least Debian, the tool is called md5sum.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Moved the library sources into src/, and the sketch into examples/. This
makes it easier to use the project as a library, and the default
firmware sketch shows up in Arduino IDE's Files/Examples menu. This in
turn, has a very neat side effect: an end user can start from this
example, and when they save it, it will be saved to their Sketchbook,
and the library can be updated independently, without having to worry
about conflicts.
Having the Sketch separate from the sources also paves the way for
moving the keymap there.
As far as Arduino IDE dependencies go: this requires Arduino IDE 1.6.7+,
the same minimum version required previously.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Two things are done here: loop() hooks are introduced, and both loop and
event handler hooks are pre-allocated for HOOK_MAX (64 by default)
elements.
Two helpers are introduced too, that make it easier to append a new hook
to the end of these arrays.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
The function is not used anymore, there's a different, better way to
hook into the event handler now.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Instead of a single custom function, have an array of functions that get
called in order, until one of them returns true. Defaults to the normal
event handler.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Instead of always calling handle_user_key_event(), call a function
pointed to by the customHandler variable. This makes it possible to
override what function gets called, at run time, at very little cost.
The reason for this change is to be able to change the user function
into a testing one, if a magic combo is pressed, while still allowing
the end-user to fully customize handle_user_key_event, and allow them to
have access to the testing one too, without them doing anything special.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This allows external libraries to look up the keycode for a given
position, without having to reimplement the keymap themselves. This
becomes important when you hook into the event processing.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>