1
0
forked from drath/libratbag

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:
Peter Hutterer
2015-09-10 06:38:03 +10:00
parent 43386ae31d
commit 69bb5d2f48
4 changed files with 12 additions and 0 deletions

View File

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

View File

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

View File

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

View File

@@ -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,
};
/**