diff options
Diffstat (limited to 'keyboards/wuque/mammoth75x/mammoth75x.c')
-rw-r--r-- | keyboards/wuque/mammoth75x/mammoth75x.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/keyboards/wuque/mammoth75x/mammoth75x.c b/keyboards/wuque/mammoth75x/mammoth75x.c index c2bf2bbe37..3b2d995b7e 100644 --- a/keyboards/wuque/mammoth75x/mammoth75x.c +++ b/keyboards/wuque/mammoth75x/mammoth75x.c @@ -14,7 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "mammoth75x.h" +#include "quantum.h" #ifdef VIA_ENABLE static uint8_t encoder_state[NUM_ENCODERS] = {0}; @@ -30,7 +30,9 @@ void encoder_action_unregister(void) keyevent_t encoder_event = (keyevent_t){ .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], .pressed = false, - .time = (timer_read() | 1)}; + .time = timer_read(), + .type = KEY_EVENT + }; encoder_state[index] = 0; action_exec(encoder_event); } @@ -41,7 +43,9 @@ void encoder_action_register(uint8_t index, bool clockwise) keyevent_t encoder_event = (keyevent_t){ .key = clockwise ? encoder_cw[index] : encoder_ccw[index], .pressed = true, - .time = (timer_read() | 1)}; + .time = timer_read(), + .type = KEY_EVENT + }; encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); action_exec(encoder_event); } @@ -57,11 +61,4 @@ bool encoder_update_kb(uint8_t index, bool clockwise) encoder_action_register(index, clockwise); return true; }; -#else -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - tap_code_delay(clockwise ? KC_VOLU : KC_VOLD, 10); - return true; -} #endif - |