diff --git a/src/driver-roccat.c b/src/driver-roccat.c index fd0eeaec..4586c0e7 100644 --- a/src/driver-roccat.c +++ b/src/driver-roccat.c @@ -100,51 +100,6 @@ struct roccat_data { struct roccat_macro macros[(ROCCAT_PROFILE_MAX + 1)][(ROCCAT_BUTTON_MAX + 1)]; }; -struct roccat_button_type_mapping { - uint8_t raw; - enum ratbag_button_type type; -}; - -static const struct roccat_button_type_mapping roccat_button_type_mapping[] = { - { 0, RATBAG_BUTTON_TYPE_LEFT }, - { 1, RATBAG_BUTTON_TYPE_RIGHT }, - { 2, RATBAG_BUTTON_TYPE_MIDDLE }, - { 3, RATBAG_BUTTON_TYPE_EXTRA }, - { 4, RATBAG_BUTTON_TYPE_SIDE }, - { 5, RATBAG_BUTTON_TYPE_WHEEL_LEFT }, - { 6, RATBAG_BUTTON_TYPE_WHEEL_RIGHT }, - { 7, RATBAG_BUTTON_TYPE_WHEEL_UP }, - { 8, RATBAG_BUTTON_TYPE_WHEEL_DOWN }, - { 9, RATBAG_BUTTON_TYPE_RESOLUTION_UP }, - { 10, RATBAG_BUTTON_TYPE_RESOLUTION_DOWN }, -// { 11, RATBAG_BUTTON_TYPE_ }, /* top button above the wheel */ - { 12, RATBAG_BUTTON_TYPE_LEFT }, - { 13, RATBAG_BUTTON_TYPE_RIGHT }, - { 14, RATBAG_BUTTON_TYPE_MIDDLE }, - { 15, RATBAG_BUTTON_TYPE_EXTRA }, - { 16, RATBAG_BUTTON_TYPE_SIDE }, - { 17, RATBAG_BUTTON_TYPE_WHEEL_LEFT }, - { 18, RATBAG_BUTTON_TYPE_WHEEL_RIGHT }, - { 19, RATBAG_BUTTON_TYPE_WHEEL_UP }, - { 20, RATBAG_BUTTON_TYPE_WHEEL_DOWN }, - { 21, RATBAG_BUTTON_TYPE_RESOLUTION_UP }, - { 22, RATBAG_BUTTON_TYPE_RESOLUTION_DOWN }, -// { 23, RATBAG_BUTTON_TYPE_ }, /* top button above the wheel */ -}; - -static enum ratbag_button_type -roccat_raw_to_button_type(uint8_t data) -{ - const struct roccat_button_type_mapping *mapping; - - ARRAY_FOR_EACH(roccat_button_type_mapping, mapping) { - if (mapping->raw == data) - return mapping->type; - } - - return RATBAG_BUTTON_TYPE_UNKNOWN; -} - struct roccat_button_mapping { uint8_t raw; struct ratbag_button_action action; @@ -442,7 +397,6 @@ roccat_read_button(struct ratbag_button *button) action = roccat_button_to_action(button->profile, button->index); if (action) ratbag_button_set_action(button, action); - button->type = roccat_raw_to_button_type(button->index); // if (action == NULL) // log_error(device->ratbag, "button: %d -> %d %s:%d\n", // button->index, drv_data->profiles[button->profile->index][3 + button->index * 3],