From c4cf24308a60bd8490a38c12b2a54eac5edd3229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Tue, 14 Apr 2020 16:52:51 +0100 Subject: [PATCH] hidpp20: enable disabling buttons on onboard profiles (0x8100) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe LaĆ­ns --- src/driver-hidpp20.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/driver-hidpp20.c b/src/driver-hidpp20.c index 4b6aa278..976c5cdd 100644 --- a/src/driver-hidpp20.c +++ b/src/driver-hidpp20.c @@ -214,6 +214,9 @@ hidpp20drv_read_button_8100(struct ratbag_button *button) switch (profile->buttons[button->index].any.type) { case HIDPP20_BUTTON_HID_TYPE: switch (profile->buttons[button->index].subany.subtype) { + case HIDPP20_BUTTON_HID_TYPE_NOOP: + button->action.type = RATBAG_BUTTON_ACTION_TYPE_NONE; + break; case HIDPP20_BUTTON_HID_TYPE_MOUSE: button->action.type = RATBAG_BUTTON_ACTION_TYPE_BUTTON; button->action.action.button = profile->buttons[button->index].button.buttons; @@ -614,6 +617,9 @@ hidpp20drv_update_button_8100(struct ratbag_button *button) profile->buttons[button->index].special.type = HIDPP20_BUTTON_SPECIAL; profile->buttons[button->index].special.special = code; break; + case RATBAG_BUTTON_ACTION_TYPE_NONE: + profile->buttons[button->index].disabled.type = HIDPP20_BUTTON_HID_TYPE_NOOP; + break; default: return -ENOTSUP; }