blob: efa1f7a78c5eeb5a894ece69431c3c220348d407 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#pragma once
#include QMK_KEYBOARD_H
/**
* State of the tapdance, hold both the tapdance state, and the layer we need
* to activate when the key is activated.
*/
typedef struct {
td_state_t state;
uint8_t layer;
} tap_dance_layer_t;
void tap_dance_layer_finished(tap_dance_state_t *state, void *user_data);
void tap_dance_layer_reset(tap_dance_state_t *state, void *user_data);
/**
* Helper for creating the tap_dance key.
*/
#define ACTION_TAP_DANCE_LAYER(layer) \
{ \
.fn = {NULL, tap_dance_layer_finished, tap_dance_layer_reset}, \
.user_data = (void *)&((tap_dance_layer_t){TD_NONE, layer}), \
}
|