From 95b353dae5012b070ebb0672c19985be05056c33 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 19 Aug 2025 02:26:23 +0300 Subject: [PATCH] LibInput: Fix numpad keycode generation I had made this function with broken PS/2 scancode set 3, so it seemed like it worked --- userspace/libraries/LibInput/include/LibInput/KeyEvent.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/userspace/libraries/LibInput/include/LibInput/KeyEvent.h b/userspace/libraries/LibInput/include/LibInput/KeyEvent.h index 6b2cf9a8..46de73c7 100644 --- a/userspace/libraries/LibInput/include/LibInput/KeyEvent.h +++ b/userspace/libraries/LibInput/include/LibInput/KeyEvent.h @@ -22,15 +22,15 @@ namespace LibInput consteval uint8_t keycode_normal(uint8_t row, uint8_t col) { BANAN_CONSTEVAL_STATIC_ASSERT(row <= 0b111 - 1); - BANAN_CONSTEVAL_STATIC_ASSERT(col < 0b11111 - 8); + BANAN_CONSTEVAL_STATIC_ASSERT(col <= 0b11111 - 8); return ((row + 1) << 5) | col; } consteval uint8_t keycode_numpad(uint8_t row, uint8_t col) { BANAN_CONSTEVAL_STATIC_ASSERT(row <= 0b111 - 1); - BANAN_CONSTEVAL_STATIC_ASSERT(col <= 8); - return ((row + 1) << 5) | (col + 0b11111 - 8); + BANAN_CONSTEVAL_STATIC_ASSERT(col < 8); + return ((row + 1) << 5) | (col + 0b11111 - 8 + 1); } enum class Key