diff options
Diffstat (limited to 'src/input.c')
| -rw-r--r-- | src/input.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input.c b/src/input.c index f85c63c..8eaf6d0 100644 --- a/src/input.c +++ b/src/input.c @@ -256,12 +256,12 @@ static int8_t scancode_to_p8scii(SDL_Scancode sc, SDL_Keymod mod) { #define PW_SCANCODE_MOD_SHIFT 9 static bool handle_key(struct pw_input *input, SDL_KeyboardEvent *event) { - if (event->scancode < 0 || event->scancode > PW_SCANCODE_MASK) { + uint32_t sc = (uint32_t)event->scancode; + if (sc > PW_SCANCODE_MASK) { // Ignore unsupported scancodes. return true; } - uint32_t sc = (uint32_t)event->scancode; if (event->down) { sc |= PW_SCANCODE_PRESSED; } |
