Name: Kaleidoscope-GhostInTheFirmware
Owner: Keyboardio
Description: Let the keyboard type for you! For use in demoing things without hands.
Created: 2017-01-24 13:45:06.0
Updated: 2018-05-15 05:09:21.0
Pushed: 2018-05-15 05:09:22.0
Homepage: null
Size: 37
Language: C++
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Born out of the desire to demo LED effects on the keyboard without having to
touch it by hand (which would obstruct the video), the GhostInTheFirmware
plugin allows one to inject events at various delays, by telling it which keys
to press. Unlike macros, these press keys at given positions, as if they were
pressed by someone typing on it - the firmware will not see the difference.
Given a sequence (with press- and delay times), the plugin will walk through it once activated, and hold the key for the specified amount, release it, and move on to the next after the delay time.
To use the plugin, one needs to include the header, and configure it with a list of key coordinates, a press time, and a delay time quartett. One also needs a way to trigger starting the sequence, and a macro is the most convenient way for that.
lude <Kaleidoscope.h>
lude <Kaleidoscope-GhostInTheFirmware.h>
lude <Kaleidoscope-Macros.h>
t macro_t *macroAction(uint8_t macro_index, uint8_t key_state) {
(macro_index == 0 && keyToggledOn(key_state))
GhostInTheFirmware.activate();
turn MACRO_NONE;
ic const kaleidoscope::GhostInTheFirmware::GhostKey ghost_keys[] PROGMEM = {
, 0, 200, 50},
, 0, 0}
IDOSCOPE_INIT_PLUGINS(GhostInTheFirmware,
Macros);
setup() {
leidoscope.setup ();
ostInTheFirmware.ghost_keys = ghost_keys;
The plugin won't be doing anything until its activate()
method is called -
hence the macro.
The plugin provides the GhostInTheFirmware
object, which has the following
methods and properties:
.activate()
Start playing back the sequence. Best called from a macro.
.ghost_keys
Set this property to the sequence of keys to press, by assigning a sequence to this variable. Each element is a quartett of
row
,column
, apressTime
, and adelay
. Each of these will be pressed in different cycles, unlike macros which play back within a single cycle.The key at
row
,column
will be held forpressTime
milliseconds, and after an additionaldelay
milliseconds, the plugin will move on to the next entry in the sequence.The sequence MUST reside in
PROGMEM
.
Starting from the example is the recommended way of getting started with the plugin.