Make the driver responsible for creating them on startup, then just return the
one we already have.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is something better handled by mapping the various button types into a
specific string on the client-side.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
HID++ 1.0 doesn't have an index of functions available, so we pretty much
have to bang every request against the device, full of hope and optimism.
Reality demands that some of them fail and we handle that, but we don't need
to worry the user by screaming errors.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The OS X tool for Logitech's gaming mouse did not allow button-profiles on the
G500s, but DPI modes could be configured. This is an issue with the software,
not the device itself since the device supports muliple profiles. So the
original assumption that there are devices that have profiles for DPIs but not
buttons is likely wrong, the devices we looked at so far all have profiles
with a set of DPI modes in it, one of which is currently active.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We don't know the HID++ 1.0 request to check for the number of buttons or
profiles, this is the next-best thing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
and relocate the raw value 0 of RATBAG_BUTTON_TYPE_NONE to be below 0x06.
The windows application sets 0x06 when disabling a button.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Not that we can configure much, but 0x1b00 sends 5 buttons, which is
the reality, so trying to include it too.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Profiles are... interesting
https://github.com/cvuchener/g500/blob/master/doc/profile.md is pretty
detailed on the information, but there's some oddities.
The profile configured on my mouse is on page 5, not sure if that's the OS X
logitech tool though (which doesn't do profile configuration btw). Pages 3 and
3 are valid too, the rest looks to be garbage.
There's probably some magic string to detect a profile (cvuchener says maybe
FF 00 00 80), so more profiles may be lying around elsewhere in memory...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This also changes from the "toggle" to a plain "set". If a caller needs to
toggle a specific function, it can run get + set instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Only enabled for 4 leds and I'm not even sure they're the same on all
devices. Still, works on the G500s so that's a good enough start.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Missing return statement caused everything to be freed again. And the device
we initialized was discarded too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Looks a bit more like the hidpp20 driver now, and easier to get a handle on
everything. Command-specific functions/defines are grouped together and sorted
by command index.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>