diff options
author | Kate Hsuan <hpa@redhat.com> | 2024-05-16 14:32:24 +0800 |
---|---|---|
committer | Kate Hsuan <hpa@redhat.com> | 2024-05-16 16:19:47 +0800 |
commit | 9f5c2078aca16041cdb69930d23dce07b25f392e (patch) | |
tree | 3366cdea9f3097898e495caa974ad8f90f70a25a | |
parent | 544eba5543517c278498999cd2bd2d66fb6394fa (diff) |
linux: device_supply: The new priority of device kindwip/kate/reassign-kind-priority
Give a new priority for device type since the gaming_input may include
a keyboard, a touchpad... etc, for example, a Sony DualShock4 joypad.
A mouse and a touchpad may include a mouse and a keyboard.
Therefore the priority is:
1. Audio
2. Gaming_input
3. Keyboard
4. Tablet
5. Touchpad
6. Mouse
-rw-r--r-- | src/linux/up-device-supply.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c index 27f73af..f5dcb12 100644 --- a/src/linux/up-device-supply.c +++ b/src/linux/up-device-supply.c @@ -345,14 +345,25 @@ up_device_supply_sibling_discovered_guess_type (UpDevice *device, { "ID_INPUT_KEYBOARD", UP_DEVICE_KIND_KEYBOARD }, }; /* The type priority if we have multiple siblings, - * i.e. we select the first of the current type of the found type. */ + * i.e. we select the first of the current type of the found type. + * Give a new priority for device type since the GAMING_INPUT may include + * a keyboard, a touchpad, and... etc, for example Sony DualShock4 joypad. + * A mouse and a touchpad may include a mouse and a keyboard. + * Therefor the priority is: + * 1. Audio + * 2. Gaming_input + * 3. Keyboard + * 4. Tablet + * 5. Touchpad + * 6. Mouse + */ UpDeviceKind priority[] = { UP_DEVICE_KIND_OTHER_AUDIO, + UP_DEVICE_KIND_GAMING_INPUT, UP_DEVICE_KIND_KEYBOARD, UP_DEVICE_KIND_TABLET, UP_DEVICE_KIND_TOUCHPAD, - UP_DEVICE_KIND_MOUSE, - UP_DEVICE_KIND_GAMING_INPUT, + UP_DEVICE_KIND_MOUSE }; /* Form-factors set in rules.d/78-sound-card.rules in systemd */ struct { |