Expose the timeOut variable

Fixes #4.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 8 years ago
parent dd266fd27d
commit d2fcb75844

@ -102,7 +102,16 @@ void setup (void) {
The plugin provides a `TapDance` object, but to implement the actions, we need The plugin provides a `TapDance` object, but to implement the actions, we need
to define a function ([`tapDanceAction`][tdaction]) outside of the object. A to define a function ([`tapDanceAction`][tdaction]) outside of the object. A
handler, of sorts. Nevertheless, the plugin provides one macro that is handler, of sorts. Nevertheless, the plugin provides one macro that is
particularly useful: particularly useful: `tapDanceActionKeys`. Apart from that, it provides one
method only:
### `.timeOut`
> The number of loop iterations to wait before a tap-dance sequence times out.
> Once the sequence timed out, the action for it will trigger, even without an
> interruptor. Defaults to 5, and the timer resets with every tap of the same
> Not strictly a method, it is a variable one can assign a new value to.
### `tapDanceActionKeys(tapCount, tapDanceAction, keys...)` ### `tapDanceActionKeys(tapCount, tapDanceAction, keys...)`

@ -23,7 +23,7 @@ using namespace Akela::Ranges;
namespace Akela { namespace Akela {
// --- state --- // --- state ---
uint16_t TapDance::timer; uint16_t TapDance::timer;
uint16_t TapDance::timeOut = 5; uint8_t TapDance::timeOut = 5;
uint8_t TapDance::tapCount[32]; uint8_t TapDance::tapCount[32];
uint32_t TapDance::pressedState; uint32_t TapDance::pressedState;
uint32_t TapDance::triggeredState; uint32_t TapDance::triggeredState;

@ -42,12 +42,12 @@ namespace Akela {
TapDance (void); TapDance (void);
virtual void begin (void) final; virtual void begin (void) final;
static uint8_t timeOut;
void actionKeys (uint8_t tapCount, ActionType tapDanceAction, uint8_t maxKeys, const Key tapKeys[]); void actionKeys (uint8_t tapCount, ActionType tapDanceAction, uint8_t maxKeys, const Key tapKeys[]);
private: private:
static uint16_t timer; static uint16_t timer;
static uint16_t timeOut;
static uint8_t tapCount[32]; static uint8_t tapCount[32];
static uint32_t pressedState; static uint32_t pressedState;
static uint32_t triggeredState; static uint32_t triggeredState;

Loading…
Cancel
Save