summaryrefslogtreecommitdiffstats
path: root/quantum/keyboard.h
diff options
context:
space:
mode:
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 */