-
Notifications
You must be signed in to change notification settings - Fork 0
/
support.h
37 lines (33 loc) · 1.98 KB
/
support.h
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
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef REDOX_AH_UTIL_MACRO_H_
#define REDOX_AH_UTIL_MACRO_H_
#define AH_SINGLE_TD(_name_, key1, key2) \
void dance_finished_##_name_(qk_tap_dance_state_t* state, void* user_data) { \
if (state->count == 1) { \
register_code(key1); \
} else { \
register_code(key2); \
register_code(key1); \
} \
} \
void dance_reset_##_name_(qk_tap_dance_state_t* state, void* user_data) { \
if (state->count == 1) { \
unregister_code(key1); \
} else { \
unregister_code(key2); \
unregister_code(key1); \
} \
}
#define AH_STATIC_LIGHT(COLOR) \
rgblight_enable_noeeprom(); \
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); \
rgblight_sethsv_noeeprom(COLOR);
#define AH_SEND_KEY_OR_SHIFT_THEN(key, key_then) \
if ((mods | get_oneshot_mods()) & MOD_MASK_SHIFT) { \
del_mods(MOD_MASK_SHIFT); \
del_oneshot_mods(MOD_MASK_SHIFT); \
SEND_STRING((key_then)); \
set_mods(mods); \
} else { \
SEND_STRING((key)); \
}
#endif