hidpp20: enable disabling buttons on onboard profiles (0x8100)

Signed-off-by: Filipe Laíns <lains@archlinux.org>
This commit is contained in:
Filipe Laíns
2020-04-14 16:52:51 +01:00
committed by Yaroslav Chvanov
parent 39b8f2bce2
commit c4cf24308a

View File

@@ -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;
}