aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/process_keycode
diff options
context:
space:
mode:
authorpmalecka <pmalecka@users.noreply.github.com>2017-12-01 09:09:52 +0100
committerJack Humbert <jack.humb@gmail.com>2018-01-12 12:56:21 -0500
commita01dc4dd489a8ab2919bf9b7e8389d87ef5ccf64 (patch)
treef386ab228711ca2055d9e49d0a4adb78d88d4147 /quantum/process_keycode
parent4764e7712109be63df6395d70b069bceb0258e61 (diff)
downloadfirmware-a01dc4dd489a8ab2919bf9b7e8389d87ef5ccf64.tar.gz
firmware-a01dc4dd489a8ab2919bf9b7e8389d87ef5ccf64.tar.bz2
firmware-a01dc4dd489a8ab2919bf9b7e8389d87ef5ccf64.zip
added the possibility to hav shifted(modded) tap dance
Diffstat (limited to 'quantum/process_keycode')
-rw-r--r--quantum/process_keycode/process_tap_dance.c4
-rw-r--r--quantum/process_keycode/process_tap_dance.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c
index f1f28e016..f196a9cb6 100644
--- a/quantum/process_keycode/process_tap_dance.c
+++ b/quantum/process_keycode/process_tap_dance.c
@@ -79,6 +79,7 @@ static inline void process_tap_dance_action_on_dance_finished (qk_tap_dance_acti
return;
action->state.finished = true;
add_mods(action->state.oneshot_mods);
+ add_weak_mods(action->state.weak_mods);
send_keyboard_report();
_process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_dance_finished);
}
@@ -87,6 +88,7 @@ static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t *act
{
_process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_reset);
del_mods(action->state.oneshot_mods);
+ del_weak_mods(action->state.weak_mods);
send_keyboard_report();
}
@@ -110,6 +112,8 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
action->state.count++;
action->state.timer = timer_read();
action->state.oneshot_mods = get_oneshot_mods();
+ action->state.weak_mods = get_mods();
+ action->state.weak_mods |= get_weak_mods();
process_tap_dance_action_on_each_tap (action);
if (last_td && last_td != keycode) {
diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h
index 37a27c536..ab20ea04e 100644
--- a/quantum/process_keycode/process_tap_dance.h
+++ b/quantum/process_keycode/process_tap_dance.h
@@ -25,6 +25,7 @@ typedef struct
{
uint8_t count;
uint8_t oneshot_mods;
+ uint8_t weak_mods;
uint16_t keycode;
uint16_t timer;
bool interrupted;