LibInput: Fix numpad keycode generation

I had made this function with broken PS/2 scancode set 3, so it seemed
like it worked
This commit is contained in:
Bananymous 2025-08-19 02:26:23 +03:00
parent 6560f229b1
commit 95b353dae5
1 changed files with 3 additions and 3 deletions

View File

@ -22,15 +22,15 @@ namespace LibInput
consteval uint8_t keycode_normal(uint8_t row, uint8_t col) consteval uint8_t keycode_normal(uint8_t row, uint8_t col)
{ {
BANAN_CONSTEVAL_STATIC_ASSERT(row <= 0b111 - 1); 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; return ((row + 1) << 5) | col;
} }
consteval uint8_t keycode_numpad(uint8_t row, uint8_t col) consteval uint8_t keycode_numpad(uint8_t row, uint8_t col)
{ {
BANAN_CONSTEVAL_STATIC_ASSERT(row <= 0b111 - 1); BANAN_CONSTEVAL_STATIC_ASSERT(row <= 0b111 - 1);
BANAN_CONSTEVAL_STATIC_ASSERT(col <= 8); BANAN_CONSTEVAL_STATIC_ASSERT(col < 8);
return ((row + 1) << 5) | (col + 0b11111 - 8); return ((row + 1) << 5) | (col + 0b11111 - 8 + 1);
} }
enum class Key enum class Key