summaryrefslogtreecommitdiff
path: root/keyboards/wuque/mammoth20x/mammoth20x.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/wuque/mammoth20x/mammoth20x.c')
-rw-r--r--keyboards/wuque/mammoth20x/mammoth20x.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/keyboards/wuque/mammoth20x/mammoth20x.c b/keyboards/wuque/mammoth20x/mammoth20x.c
index 6cc1dee21a..eeaea79c71 100644
--- a/keyboards/wuque/mammoth20x/mammoth20x.c
+++ b/keyboards/wuque/mammoth20x/mammoth20x.c
@@ -14,8 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "mammoth20x.h"
-
+#include "quantum.h"
static uint8_t encoder_state[NUM_ENCODERS] = {0};
static keypos_t encoder_cw[NUM_ENCODERS] = ENCODERS_CW_KEY;
@@ -30,7 +29,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 +42,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);
}