summaryrefslogtreecommitdiffstats
path: root/quantum/keyboard.h
diff options
context:
space:
mode:
authorlokher <lokher@gmail.com>2023-04-26 16:32:15 +0800
committerlokher <lokher@gmail.com>2023-04-26 16:32:15 +0800
commite4f4ceaf3f2e3d25fb282273a81f9b58790fc427 (patch)
treec0a257eab0ffe5238fdf2c04882e8ee1fe8fc46e /quantum/keyboard.h
parent103badc87cb50db1ff3851c84331e86ba78fb681 (diff)
merge upstream 713427c
Diffstat (limited to 'quantum/keyboard.h')
-rw-r--r--quantum/keyboard.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/quantum/keyboard.h b/quantum/keyboard.h
index 86ce65aac1..d0b52dd13a 100644
--- a/quantum/keyboard.h
+++ b/quantum/keyboard.h
@@ -53,6 +53,9 @@ typedef struct {
static inline bool IS_NOEVENT(keyevent_t event) {
return event.time == 0 || (event.key.row == KEYLOC_TICK && event.key.col == KEYLOC_TICK);
}
+static inline bool IS_EVENT(keyevent_t event) {
+ return !IS_NOEVENT(event);
+}
static inline bool IS_KEYEVENT(keyevent_t event) {
return event.key.row < MATRIX_ROWS && event.key.col < MATRIX_COLS;
}
@@ -63,10 +66,10 @@ static inline bool IS_ENCODEREVENT(keyevent_t event) {
return event.key.row == KEYLOC_ENCODER_CW || event.key.row == KEYLOC_ENCODER_CCW;
}
static inline bool IS_PRESSED(keyevent_t event) {
- return !IS_NOEVENT(event) && event.pressed;
+ return IS_EVENT(event) && event.pressed;
}
static inline bool IS_RELEASED(keyevent_t event) {
- return !IS_NOEVENT(event) && !event.pressed;
+ return IS_EVENT(event) && !event.pressed;
}
/* Common keyevent object factory */