mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
tools: put the list of possible button action types into a const
This commit is contained in:
@@ -648,8 +648,18 @@ class RatbagdButton(metaclass=MetaRatbag):
|
||||
@property
|
||||
def action_types(self):
|
||||
"""An array of possible values for ActionType."""
|
||||
return [t for t in (RatbagdButton.ActionType.BUTTON, RatbagdButton.ActionType.SPECIAL, RatbagdButton.ActionType.KEY, RatbagdButton.ActionType.MACRO)
|
||||
if libratbag.ratbag_button_has_action_type(self._button, t)]
|
||||
POSSIBLE_ACTION_TYPES = (
|
||||
RatbagdButton.ActionType.BUTTON,
|
||||
RatbagdButton.ActionType.SPECIAL,
|
||||
RatbagdButton.ActionType.KEY,
|
||||
RatbagdButton.ActionType.MACRO,
|
||||
)
|
||||
|
||||
return [
|
||||
t
|
||||
for t in POSSIBLE_ACTION_TYPES
|
||||
if libratbag.ratbag_button_has_action_type(self._button, t)
|
||||
]
|
||||
|
||||
def disable(self):
|
||||
"""Disables this button."""
|
||||
|
||||
Reference in New Issue
Block a user