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>
Etekcity mice have volume up/down mapped on the 2 buttons on the right
side of the mouse. They get easily pressed by the hand and can annoy the
user. This command switches on and off these buttons.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This allows to test ratbag_device_set_active_profile() and the
.write_profile() callback from the drivers.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
When accessing the buttons of a profile, we should not unref it until
we are done (or there will be some illegal access to a free-ed pointer).
The last profile_unref should be called against the active_profile, not
the last profile.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Naming scheme is now:
* ratbag - the context
* ratbag_device - the device
* ratbag_profile
* ratbag_button
...
Only leftovers of "libratbag" are the header file name, #defines that are
exported through that header file and anything that has to do with the actual
library iself (e.g. the symbol export file).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Looks like a command name before the current ratbag-command one, and since
this is a static method anyway just usage() will do.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Put the code in place for a multi-command tool, first command is
ratbag-command info /path/to/device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Same as libinput. Since we need to open device files we need something that's
authorized to open them. So we punt that to the caller.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We don't need the evdev fd, it's more flexible to start with a udev device.
This changes ratbag-command to take a /sys path as well, but for not it'll
do.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Problem is the current implementation requires to actually get the profile
before accessing the buttons. But it may be the simplest and safest way.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Most gaming mice use a specific HID protocol to configure the device.
Allow to retrieve the hidraw node associated to the mouse so we can talk
to it.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>