Gergely Nagy
051778048d
Turn the plugin into a macro
...
The expected usage is now calling `NumLock.toggle(row, col, layer)` from within
a macro.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
ace478116f
Make the macros aware of the row/col they were pressed at
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
1c8487c77a
Adjust hexToKey for the keyCode/flags swap in Key
...
For some reason, I missed this before - correcting now.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
8431e3a48a
Make LED modes automatically use LEDControl
...
This way the end-user does not have to explicitly call
`Keyboardio.use(&LEDControl)`, it is enough to use a LED effect.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
8fc1d14630
hooks: Drop the deprecated functions
...
All of the plugins have been updated, there is no need to keep the deprecated
functions around anymore.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Jesse Vincent
84d7a3ccb0
Merge pull request #90 from algernon/f/LEDs/lift-off
...
Move the LED stuff into a plugin
8 years ago
Jesse Vincent
06e5a2b981
Merge pull request #92 from algernon/h/layers/toggle-fix
...
layers: Fix the layer toggle behaviour
8 years ago
Gergely Nagy
975cd0bf04
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
dcd8d8405e
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
fbe6293655
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
2ba371c9e6
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
e5fabbce79
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
84b2b6ad62
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
6a8eb4dd48
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
6497d3ae8f
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
71815cd0f3
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
ba0b69bb89
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
5394fc834f
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
dd266fd27d
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
9a2f79e42d
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
7dbb5b39e0
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
bb2df55e09
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
93bd914296
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
a2ce233531
Use the new, double-add protected hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Jesse Vincent
572f3407da
Merge pull request #91 from algernon/f/hooks/double-register-protection
...
hooks: Double-registration protection
8 years ago
Jesse Vincent
93d6f46953
Merge pull request #93 from algernon/f/NumLock
...
key_defs: Add Key_NumLock
8 years ago
Gergely Nagy
7057b0864c
Minor code cleanup
...
Remove a stray "private", that is not used or needed anymore.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
2c24a5163e
key_defs: Add Key_NumLock
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
ed92d5109c
Fix the LED mode handling
...
First of all, to disallow switching to LEDNumlock, we need to do the check in
the `.init()` method, not in `.setup()`. Second, tracking the previous LED mode
can be done a lot simpler - and a lot reliably.
With these changes, the NumLock LED effect works as it is expected to.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
361df26094
layers: Fix the layer toggle behaviour
...
When toggling a layer, the same keycode should toggle the layer off, too.
Without this, toggling layers won't work at all, because the target layer will
never be turned off.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
420e1e9eac
Adjusted for the separate LED effect plugins
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
563a9e9ad3
Lifted out from Keyboardio-LEDControl
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
86eaa90abd
Lifted out from Keyboardio-LEDControl
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
5df5b209d7
Lifted out from Keyboardio-LEDControl
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
7a903afb69
Lifted out from Keyboardio-LEDControl
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
04902c903c
Lifted out from Keyboardio-LEDControl
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
2a35a350f1
Moved the effects to separate libraries
...
Dropped dot_a_linkage, so that the functions in LEDUtils do not get optimized
out.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
452f3bfc28
hooks: Make the _add functions emit a deprecation warning
...
Turn the `event_handler_hook_add` and `loop_hook_add` aliases into real
functions, that emit a deprecation warning during compilation. This makes it a
little bit easier to see what needs to be updated still.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
e349f882e7
hooks: Add some documentation about the various hook functions
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
eb02ca5fe6
hooks: Double-registration protection
...
In most cases, one only wants a single copy of a hook. On the other hand,
plugins that depend on other plugins, may want to make it easier for the
end-user to use the plugin, and call the setup function of the dependent plugins
too. In case the end-user calls the same setup function, we'd end up with hooks
registered multiple times.
To avoid this, protection against double-registration has been introduced. The
new `event_handler_hook_use` and `loop_hook_use` functions will only allow one
copy of the hook. The `event_handler_hook_append` and `loop_hook_append`
functions will, on the other hand, just append the hooks, and not care about
protection.
The `event_handler_hook_add` and `loop_hook_add` functions are gone, but for the
time being, they are aliases to the `_use` functions, until all plugins have
been updated, and the aliases can be removed.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
7500cef6c0
Don't use Key_LEDEffectNext in the example
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
136af1bac3
Don't use Key_LEDEffectNext in the example
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
68d1bbe6bc
Don't use Key_LEDEffectNext in the example
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
5352be64fd
Don't use Key_LEDEffectNext in the example
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
df832e8024
Don't use Key_LEDEffectNext in the example
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
981ebb13d1
Don't use Key_LEDEffectNext in the example
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
ecff024f02
Don't use Key_LEDEffectNext in the example
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
d73104de7f
Updated to use Keyboardio-LEDControl
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
a8abf11b11
Updated to use Keyboardio-LEDControl
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago
Gergely Nagy
23368b2161
Updated to use the Keyboardio-LEDControl library
...
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
8 years ago