1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#pragma once
#include QMK_KEYBOARD_H
#include "quad_tapdance.h"
typedef struct {
td_state_t state;
const uint16_t tap;
const uint16_t hold;
uint16_t held;
bool left;
} tap_hold_dance_t;
void tap_hold_dance_each(tap_dance_state_t *state, void *user_data);
void tap_hold_dance_finished(tap_dance_state_t *state, void *user_data);
void tap_hold_dance_reset(tap_dance_state_t *state, void *user_data);
void tap_hold_dance_released(tap_dance_state_t *state, void *user_data);
void tap_hold_dance_process_record(uint16_t keycode, keyrecord_t *record);
uint16_t tap_hold_dance_tapping_term(uint16_t keycode, keyrecord_t *record);
#define ACTION_TAP_HOLD_DANCE(tap, hold, left) \
{ \
.fn = {NULL, tap_hold_dance_finished, tap_hold_dance_reset, tap_hold_dance_released}, \
.user_data = (void *)&((tap_hold_dance_t){TD_NONE, tap, hold, 0, 0}), \
}
|