aboutsummaryrefslogtreecommitdiff
path: root/quantum/action_tapping.c
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-11-01 19:18:33 +0000
committerGitHub <noreply@github.com>2021-11-01 19:18:33 +0000
commit92385e30cdad61ddfc0461b1ce1340bcb494a68a (patch)
treed472f93ed9f4e42e4972630d8178a387b91a51bc /quantum/action_tapping.c
parentee371c1295f00c119dd5a1bb2f3d4acedff832a7 (diff)
downloadqmk_firmware-92385e30cdad61ddfc0461b1ce1340bcb494a68a.tar.gz
qmk_firmware-92385e30cdad61ddfc0461b1ce1340bcb494a68a.zip
Manually format develop (#15003)
Diffstat (limited to 'quantum/action_tapping.c')
-rw-r--r--quantum/action_tapping.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/quantum/action_tapping.c b/quantum/action_tapping.c
index 36839f9fa..60e56fb81 100644
--- a/quantum/action_tapping.c
+++ b/quantum/action_tapping.c
@@ -18,11 +18,11 @@
18# define IS_TAPPING_PRESSED() (IS_TAPPING() && tapping_key.event.pressed) 18# define IS_TAPPING_PRESSED() (IS_TAPPING() && tapping_key.event.pressed)
19# define IS_TAPPING_RELEASED() (IS_TAPPING() && !tapping_key.event.pressed) 19# define IS_TAPPING_RELEASED() (IS_TAPPING() && !tapping_key.event.pressed)
20# define IS_TAPPING_KEY(k) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (k))) 20# define IS_TAPPING_KEY(k) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (k)))
21#ifndef COMBO_ENABLE 21# ifndef COMBO_ENABLE
22# define IS_TAPPING_RECORD(r) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (r->event.key))) 22# define IS_TAPPING_RECORD(r) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (r->event.key)))
23#else 23# else
24# define IS_TAPPING_RECORD(r) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (r->event.key)) && tapping_key.keycode == r->keycode) 24# define IS_TAPPING_RECORD(r) (IS_TAPPING() && KEYEQ(tapping_key.event.key, (r->event.key)) && tapping_key.keycode == r->keycode)
25#endif 25# endif
26 26
27__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { return TAPPING_TERM; } 27__attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { return TAPPING_TERM; }
28 28
@@ -212,11 +212,15 @@ bool process_tapping(keyrecord_t *keyp) {
212 if (tapping_key.tap.count > 1) { 212 if (tapping_key.tap.count > 1) {
213 debug("Tapping: Start new tap with releasing last tap(>1).\n"); 213 debug("Tapping: Start new tap with releasing last tap(>1).\n");
214 // unregister key 214 // unregister key
215 process_record(&(keyrecord_t){.tap = tapping_key.tap, .event.key = tapping_key.event.key, .event.time = event.time, .event.pressed = false, 215 process_record(&(keyrecord_t){
216#ifdef COMBO_ENABLE 216 .tap = tapping_key.tap,
217 .keycode = tapping_key.keycode, 217 .event.key = tapping_key.event.key,
218#endif 218 .event.time = event.time,
219 }); 219 .event.pressed = false,
220# ifdef COMBO_ENABLE
221 .keycode = tapping_key.keycode,
222# endif
223 });
220 } else { 224 } else {
221 debug("Tapping: Start while last tap(1).\n"); 225 debug("Tapping: Start while last tap(1).\n");
222 } 226 }
@@ -254,11 +258,15 @@ bool process_tapping(keyrecord_t *keyp) {
254 if (tapping_key.tap.count > 1) { 258 if (tapping_key.tap.count > 1) {
255 debug("Tapping: Start new tap with releasing last timeout tap(>1).\n"); 259 debug("Tapping: Start new tap with releasing last timeout tap(>1).\n");
256 // unregister key 260 // unregister key
257 process_record(&(keyrecord_t){.tap = tapping_key.tap, .event.key = tapping_key.event.key, .event.time = event.time, .event.pressed = false, 261 process_record(&(keyrecord_t){
258#ifdef COMBO_ENABLE 262 .tap = tapping_key.tap,
259 .keycode = tapping_key.keycode, 263 .event.key = tapping_key.event.key,
260#endif 264 .event.time = event.time,
261 }); 265 .event.pressed = false,
266# ifdef COMBO_ENABLE
267 .keycode = tapping_key.keycode,
268# endif
269 });
262 } else { 270 } else {
263 debug("Tapping: Start while last timeout tap(1).\n"); 271 debug("Tapping: Start while last timeout tap(1).\n");
264 } 272 }