aboutsummaryrefslogtreecommitdiff
path: root/common/action.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/action.c')
-rw-r--r--common/action.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/common/action.c b/common/action.c
index ecd5a7e94..f7ae85b94 100644
--- a/common/action.c
+++ b/common/action.c
@@ -100,40 +100,29 @@ void process_action(keyrecord_t *record)
100 action.key.mods<<4; 100 action.key.mods<<4;
101 switch (action.layer_tap.code) { 101 switch (action.layer_tap.code) {
102 #ifndef NO_ACTION_ONESHOT 102 #ifndef NO_ACTION_ONESHOT
103 case 0x00: 103 case MODS_ONESHOT:
104 // Oneshot modifier 104 // Oneshot modifier
105 if (event.pressed) { 105 if (event.pressed) {
106 if (tap_count == 0) { 106 if (tap_count == 0) {
107 dprint("MODS_TAP: Oneshot: add_mods\n");
108 register_mods(mods); 107 register_mods(mods);
109 } 108 }
110 else if (tap_count == 1) { 109 else if (tap_count == 1) {
111 dprint("MODS_TAP: Oneshot: start\n"); 110 dprint("MODS_TAP: Oneshot: start\n");
112 set_oneshot_mods(mods); 111 set_oneshot_mods(mods);
113 } 112 }
114 else if (tap_count == TAPPING_TOGGLE) {
115 dprint("MODS_TAP: Oneshot: toggle\n");
116 oneshot_toggle();
117 }
118 else { 113 else {
119 dprint("MODS_TAP: Oneshot: cancel&add_mods\n");
120 // double tap cancels oneshot and works as normal modifier.
121 clear_oneshot_mods();
122 register_mods(mods); 114 register_mods(mods);
123 } 115 }
124 } else { 116 } else {
125 if (tap_count == 0) { 117 if (tap_count == 0) {
126 dprint("MODS_TAP: Oneshot: cancel/del_mods\n");
127 // cancel oneshot on hold
128 clear_oneshot_mods(); 118 clear_oneshot_mods();
129 unregister_mods(mods); 119 unregister_mods(mods);
130 } 120 }
131 else if (tap_count == 1) { 121 else if (tap_count == 1) {
132 // Oneshot 122 // Retain Oneshot mods
133 } 123 }
134 else { 124 else {
135 dprint("MODS_TAP: Oneshot: del_mods\n"); 125 clear_oneshot_mods();
136 // cancel Mods
137 unregister_mods(mods); 126 unregister_mods(mods);
138 } 127 }
139 } 128 }