From 5f489ba71b64ee6536d9bda8009859b5be577105 Mon Sep 17 00:00:00 2001 From: Karl Fleischmann Date: Tue, 2 Jun 2026 14:54:11 +0200 Subject: [PATCH] daemon: input, keymap - Vacant keymap slot 129 Move "ctrlwheelcw" to another place to make room for scan code 129. Potentially this creates another conflict for a currently unhandled scancode. --- src/daemon/input.c | 2 +- src/daemon/keymap.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/daemon/input.c b/src/daemon/input.c index 4229696f..22814c58 100644 --- a/src/daemon/input.c +++ b/src/daemon/input.c @@ -12,7 +12,7 @@ #define IS_VOLWHEEL(scan) (((scan) == KEY_VOLUMEUP || (scan) == KEY_VOLUMEDOWN) && DEV_HAS_VOLWHEEL(kb)) // Lookup control wheel events by index in keymap. Alternatively one could check for non-null key->name to start with "ctrlwheel". // FIXME: Replace by proper lookup of map in keymap. -#define IS_CTRLWHEEL(kb, index) ((kb)->protocol == PROTO_BRAGI && ((index) == 129 || (index) == 130)) +#define IS_CTRLWHEEL(kb, index) ((kb)->protocol == PROTO_BRAGI && ((index) == 116 || (index) == 130)) static int macromask(const uchar* keys, const uchar* macro){ // Scan a macro against key input. Return 0 if any of them don't match diff --git a/src/daemon/keymap.c b/src/daemon/keymap.c index e6d34dc3..423112de 100644 --- a/src/daemon/keymap.c +++ b/src/daemon/keymap.c @@ -442,7 +442,7 @@ const key keymap_bragi[N_KEYS_BRAGI_PATCH] = { { "light", 113, KEY_CORSAIR }, { "lock", 1, KEY_CORSAIR }, { "ro", 115, KEY_RO }, - { 0, -1, KEY_NONE }, + { "ctrlwheelcw", -1, KEY_CORSAIR }, { 0, -1, KEY_NONE }, { 0, -1, KEY_NONE }, { 0, -1, KEY_NONE }, @@ -455,7 +455,7 @@ const key keymap_bragi[N_KEYS_BRAGI_PATCH] = { { "prev", 126, KEY_PREVIOUSSONG }, { "mr", -1, KEY_CORSAIR }, { "profswitch", 128, KEY_CORSAIR }, - { "ctrlwheelcw", -1, KEY_CORSAIR }, + { 0, -1, KEY_NONE }, { "ctrlwheelccw", -1, KEY_CORSAIR }, { "g1", 131, KEY_CORSAIR }, { "g2", 132, KEY_CORSAIR }, @@ -901,7 +901,7 @@ void process_input_urb(void* context, unsigned char* buffer, int urblen, ushort // Always clear the control wheel key bits. // This will enable the daemon to emulate keyup events in inputupdate_keys(). if (DEV_HAS_CTRLWHEEL(kb)) { - CLEAR_KEYBIT(targetkb->input.keys, 129); + CLEAR_KEYBIT(targetkb->input.keys, 116); CLEAR_KEYBIT(targetkb->input.keys, 130); } @@ -918,7 +918,7 @@ void process_input_urb(void* context, unsigned char* buffer, int urblen, ushort memcpy(&wheel, buffer + 4, sizeof(int32_t)); if(wheel > 0) { // Apply fresh key data: clockwise rotation - SET_KEYBIT(targetkb->input.keys, 129); + SET_KEYBIT(targetkb->input.keys, 116); } else { // Apply fresh key data: counter-clockwise rotation SET_KEYBIT(targetkb->input.keys, 130);