libratbag / libratbag

A DBus daemon to configure input devices, mainly high-end and gaming mice
MIT License
2.07k stars 253 forks source link

Capabilities to handle device types #1025

Open stephanlachnit opened 4 years ago

stephanlachnit commented 4 years ago

If we merge #931, we have a "device type" property, which helps downstream users (i. e. Piper) to better allow certain settings.

For example, for mice we genuinely don't want users allow to map their primary buttons accidentally away, since that could make their system unusable (or at least hard to use for some), but for keyboards this doesn't apply. A different possible usecase might be to change the interface depending on the device type, for example for keyboards it's easier to assign buttons while actually pressing at their position on a picture, which isn't true necessarily true for mice.

However, @whot raised the question if a device type property is the best way forward, since maintaining a list of devices types can quickly break the API if a new device type is to be added (for example a "headset" type, or whatever might come in the future).

A better way would be to give every device a certain set of capabilities described in their device file. Here are some examples:

Could be a consideration for #629.

FFY00 commented 4 years ago

it might have onboard profiles

Why does this make sense?

I see everything here as a parallel to the device type. Asking what kind of device it is, is a fair question. This can be used in piper to for eg. group the devices, tweak or redesign the way they are displayed, etc.

stephanlachnit commented 4 years ago

it might have onboard profiles

Why does this make sense?

If you want to select between certain profiles, you might want to add some UI stuff for that. We don't necessarily need a capability for all of these, see https://github.com/libratbag/libratbag/issues/646.

I see everything here as a parallel to the device type. Asking what kind of device it is, is a fair question. This can be used in piper to for eg. group the devices, tweak or redesign the way they are displayed, etc.

Good point actually.

FFY00 commented 4 years ago

If you want to select between certain profiles, you might want to add some UI stuff for that. We don't necessarily need a capability for all of these, see #646.

What do you mean by select? Select which profiles are active? Select the profile in use?

stephanlachnit commented 4 years ago

If you want to select between certain profiles, you might want to add some UI stuff for that. We don't necessarily need a capability for all of these, see #646.

What do you mean by select? Select which profiles are active? Select the profile in use?

Yes exactly, which profile to edit/use. I know that it's possible in Piper, just wanted to mention it for the sake of completeness.

FFY00 commented 4 years ago

What kind of information would you need to know from the device? This is unrelated to the device supporting onboard profiles.

whot commented 4 years ago

IMO onboard profiles aren't a capability but an implementation detail.

I see everything here as a parallel to the device type. Asking what kind of device it is, is a fair question. This can be used in piper to for eg. group the devices, tweak or redesign the way they are displayed, etc.

all these are UI decisions that can be made independently of a ratbag device type. you can easily say that any device with buttons is a mouse and for the vast majority of devices the few that fall out don't matter. And for ratbag it definitely doesn't matter because we don't care about it for configuration - it's a UI thing only.

closest comparison i can think of is libinput, it doesn't do device types, only capabilities. so GNOME for example says anything that supports tapping is a touchpad which is close enough. Those checks can change whenever gnome needs them differently and long-term they're probably more reliable than whatever device type we'd have thought of 7y ago. e.g. you may care about touchpads vs clickpads which a device type won't let you do.

anyway, it helps to keep a focus on what ratbag actually does which is configure device features. the device shape doesn't matter when you're changing a button mapping or an LED colour.

K1ngjulien commented 3 years ago

any update on this?