Introduce IS_EVENT instead of !IS_NOEVENT (#19366)
This commit is contained in:
parent
dedc54a328
commit
85984902cf
3 changed files with 15 additions and 12 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue