When the button is not redirected, we need to rely on the control_id,
not the task_id to get the logical action of the button.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Problem: when a button is diverted, it stops sending its original button,
which is good, but then reports only on the HID++ long report collection.
That is a little bit embarrassing.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
well, there is no fine grain while outputing the raw events, so that
means that we have always shown the actual answer just before.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
I misread the documentation. The task_id corresponds to what the button
has been physically designed to, and the control_id is the logical
remapping.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
The function does not take any argument, so the device ignores it,
but valgrind complains.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
And remove the spurious comments that have been introduced in
f759cbdcef ("drivers: do not declare defines that are used only once").
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This driver is really a driver for HID++ 2.0 devices, not just for devices on
the unifying receiver.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The 2.0 GetProtocolVersion request will fail on 1.0 devices but there is no
equivalent for 1.0. The doc even suggests to detect this error to determine
whether a device is a 1.0 device. Thus, make it conditional on whether we
print the error or not (log it as debug message if turned off).
This should be reconsidered when we have everything in place and can think
about refacturing.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
0x8 was a random SW number picked, add that consistently and automatically so
it doesn't look like the command names require this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
There is no gain at declaring the PID of the mice we support in
libratbag-private.h
Make it per driver, and remove the extra declarations.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Lokks like the G500 needs a device_idx of 0x00, and the MX Master while on
Bluetooth only answers to report longs
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
The Logitech devices talk HID++, and we need a lib to handle that.
The first implemented command is the get protocol version which allows
to know if the device is using hid++ 1.0 or 2.0.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
The M705 talks HID++ 1.0 but the actual button toggle is not persistent.
So there is no real need to support this in libratbag for now.
This will allow to properly address the other devices.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Starting with kernel v3.19, the hidraw node associated to the input node
talks the the actual device, no matter which device index is given.
There is no need to really know which device has which index thus.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
There is not much available now, but the mouse should provide configurable
DPI and buttons, which is a perfect test for libratbag.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>