mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 15:14:38 +01:00
Add a default profile capability
Not all devices allow setting a default profile, make it a capability Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -262,6 +262,8 @@ etekcity_has_capability(const struct ratbag_device *device,
|
||||
case RATBAG_DEVICE_CAP_BUTTON_KEY:
|
||||
case RATBAG_DEVICE_CAP_BUTTON_MACROS:
|
||||
return 1;
|
||||
case RATBAG_DEVICE_CAP_DEFAULT_PROFILE:
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -104,6 +104,7 @@ hidpp10drv_has_capability(const struct ratbag_device *device,
|
||||
case RATBAG_DEVICE_CAP_SWITCHABLE_RESOLUTION:
|
||||
case RATBAG_DEVICE_CAP_BUTTON_KEY:
|
||||
case RATBAG_DEVICE_CAP_BUTTON_MACROS:
|
||||
case RATBAG_DEVICE_CAP_DEFAULT_PROFILE:
|
||||
return (device->num_profiles > 1);
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -149,6 +149,7 @@ hidpp20drv_has_capability(const struct ratbag_device *device,
|
||||
return !!(drv_data->capabilities & HIDPP_CAP_BUTTON_KEY_1b04);
|
||||
case RATBAG_DEVICE_CAP_SWITCHABLE_PROFILE:
|
||||
case RATBAG_DEVICE_CAP_BUTTON_MACROS:
|
||||
case RATBAG_DEVICE_CAP_DEFAULT_PROFILE:
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -435,6 +435,14 @@ enum ratbag_device_capability {
|
||||
* The device supports user-defined key or button sequences.
|
||||
*/
|
||||
RATBAG_DEVICE_CAP_BUTTON_MACROS,
|
||||
|
||||
/**
|
||||
* The device can have one profile assigned as a default profile.
|
||||
* A default profile is the profile that is selected when the device
|
||||
* is plugged in. Devices without this capability may select the
|
||||
* last-used profile or a specific profile (usually the first).
|
||||
*/
|
||||
RATBAG_DEVICE_CAP_DEFAULT_PROFILE,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user