diff options
Diffstat (limited to 'users/drashna/keyrecords/tapping.c')
-rw-r--r-- | users/drashna/keyrecords/tapping.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/users/drashna/keyrecords/tapping.c b/users/drashna/keyrecords/tapping.c new file mode 100644 index 000000000..9c4892b33 --- /dev/null +++ b/users/drashna/keyrecords/tapping.c | |||
@@ -0,0 +1,64 @@ | |||
1 | // Copyright 2021 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com> | ||
2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
3 | |||
4 | #include "drashna.h" | ||
5 | |||
6 | __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { | ||
7 | switch (keycode) { | ||
8 | case BK_LWER: | ||
9 | return TAPPING_TERM + 25; | ||
10 | default: | ||
11 | return TAPPING_TERM; | ||
12 | } | ||
13 | } | ||
14 | |||
15 | __attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) { | ||
16 | // Immediately select the hold action when another key is tapped: | ||
17 | // return true; | ||
18 | // Do not select the hold action when another key is tapped. | ||
19 | // return false; | ||
20 | switch (keycode) { | ||
21 | default: | ||
22 | return false; | ||
23 | } | ||
24 | } | ||
25 | |||
26 | __attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { | ||
27 | // Immediately select the hold action when another key is pressed. | ||
28 | // return true; | ||
29 | // Do not select the hold action when another key is pressed. | ||
30 | // return false; | ||
31 | switch (keycode) { | ||
32 | case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: | ||
33 | return true; | ||
34 | default: | ||
35 | return false; | ||
36 | } | ||
37 | } | ||
38 | |||
39 | __attribute__((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode, keyrecord_t *record) { | ||
40 | // Do not force the mod-tap key press to be handled as a modifier | ||
41 | // if any other key was pressed while the mod-tap key is held down. | ||
42 | // return true; | ||
43 | // Force the mod-tap key press to be handled as a modifier if any | ||
44 | // other key was pressed while the mod-tap key is held down. | ||
45 | // return false; | ||
46 | switch (keycode) { | ||
47 | default: | ||
48 | return true; | ||
49 | } | ||
50 | } | ||
51 | |||
52 | __attribute__((weak)) bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { | ||
53 | switch (keycode) { | ||
54 | default: | ||
55 | return false; | ||
56 | } | ||
57 | } | ||
58 | |||
59 | __attribute__((weak)) bool get_retro_tapping(uint16_t keycode, keyrecord_t *record) { | ||
60 | switch (keycode) { | ||
61 | default: | ||
62 | return false; | ||
63 | } | ||
64 | } | ||