diff --git a/src/etekcity.c b/src/etekcity.c index bf594c94..535165ae 100644 --- a/src/etekcity.c +++ b/src/etekcity.c @@ -115,6 +115,7 @@ struct etekcity_button_mapping { }; static struct etekcity_button_mapping etekcity_button_mapping[] = { + { 0, RATBAG_BUTTON_TYPE_NONE }, { 1, RATBAG_BUTTON_TYPE_LEFT }, { 2, RATBAG_BUTTON_TYPE_RIGHT }, { 3, RATBAG_BUTTON_TYPE_MIDDLE }, @@ -290,13 +291,11 @@ etekcity_read_button(struct ratbag_device *device, struct ratbag_profile *profil unsigned index = etekcity_button_to_index(button->index); data = drv_data->profiles[profile->index][3 + index * 3]; - if (data) { - log_debug(device->ratbag, - " - button%d: %s (%02x) %s:%d\n", - button->index, print_key(data), data, __FILE__, __LINE__); - button->type = etekcity_raw_to_button_type(data); - button->action_type = etekcity_raw_to_action(data, button->type); - } + log_debug(device->ratbag, + " - button%d: %s (%02x) %s:%d\n", + button->index, print_key(data), data, __FILE__, __LINE__); + button->type = etekcity_raw_to_button_type(data); + button->action_type = etekcity_raw_to_action(data, button->type); } static int diff --git a/src/libratbag.h b/src/libratbag.h index 1d62e4aa..9b86f025 100644 --- a/src/libratbag.h +++ b/src/libratbag.h @@ -500,6 +500,9 @@ enum ratbag_button_type { RATBAG_BUTTON_TYPE_KEY_REFRESH, RATBAG_BUTTON_TYPE_KEY_HOMEPAGE, RATBAG_BUTTON_TYPE_KEY_SEARCH, + + /* disabled button */ + RATBAG_BUTTON_TYPE_NONE, }; /** diff --git a/tools/ratbag-command.c b/tools/ratbag-command.c index ae91c48d..2a9951cf 100644 --- a/tools/ratbag-command.c +++ b/tools/ratbag-command.c @@ -174,6 +174,9 @@ button_type_to_str(enum ratbag_button_type type) case RATBAG_BUTTON_TYPE_KEY_REFRESH: str = "key refresh"; break; case RATBAG_BUTTON_TYPE_KEY_HOMEPAGE: str = "key homepage"; break; case RATBAG_BUTTON_TYPE_KEY_SEARCH: str = "key search"; break; + + /* disabled button */ + case RATBAG_BUTTON_TYPE_NONE: str = "none"; break; } return str;