diff options
Diffstat (limited to 'common/keyboard.h')
-rw-r--r-- | common/keyboard.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/common/keyboard.h b/common/keyboard.h index 84f03c9a68..dd1ebb2bd0 100644 --- a/common/keyboard.h +++ b/common/keyboard.h @@ -42,13 +42,18 @@ typedef struct { uint16_t time; } keyevent_t; -#define KEYEQ(keya, keyb) (keya.raw == keyb.raw) -#define IS_NOEVENT(event) (event.time == 0) +#define KEYEQ(keya, keyb) ((keya).raw == (keyb).raw) +#define IS_NOEVENT(event) ((event).key.pos.row == 255 && (event).key.pos.col == 255) #define NOEVENT (keyevent_t){ \ .key.pos = (keypos_t){ .row = 255, .col = 255 }, \ .pressed = false, \ .time = 0 \ } +#define TICK (keyevent_t){ \ + .key.pos = (keypos_t){ .row = 255, .col = 255 }, \ + .pressed = false, \ + .time = timer_read() \ +} extern uint8_t current_layer; |