1
0
forked from drath/libratbag
Commit Graph

1475 Commits

Author SHA1 Message Date
Thomas Hindoe Paaboel Andersen
a0830a8aaa add helpers to convert keypress to/from macro
Adds two helpers to ease the conversion between
key+modifiers and a macro. These are only intended
for single-key presses, not long macros.
2018-02-22 11:08:46 +01:00
Yanko Kaneti
02cbfc23b7 tools: Heed various PyGIDeprecationWarnings 2018-02-21 12:10:48 +10:00
Thomas Hindoe Paaboel Andersen
3da2630158 .device: add MacroLength for steelseries
Adds a setting to specify the max length of key press macros that the
device supports.

Setting MacroLength to 1 means that the device supports normal key presses,
(key + modifiers) but not multi key press macros.

0 can be used to indicate that buttons cannot be set as keys at all.
2018-02-16 09:13:58 +10:00
Thomas Hindoe Paaboel Andersen
e02d0724a3 steelseries: set LED capabilities
The Rival and earlier versions did not support cycle mode on the device.
2018-02-15 09:48:22 +10:00
Thomas Hindoe Paaboel Andersen
920fb3917f steelseries: support the original Rival
Initial support for the original Rival mouse.
Setting resolutions, report rate and LED color and
modes.

No key mappings yet, and breathing duration is fixed.
2018-02-14 14:45:24 +10:00
Thomas Hindoe Paaboel Andersen
f36b2dbce9 steelseries: default resolutions to 800/1600
The steelseries mice have 2 resolutions. The range/interval
is different per device. We cannot query the devices, so we
have to pick some defaults. Before we took the two first in
the list to be safe. It is a pretty bad default though. Using
800 and 1600 is supported by all known devices and seem as
more reasonable defaults.
2018-02-14 14:41:19 +10:00
Thomas Hindoe Paaboel Andersen
ef7e6f6db5 steelseries: correct use of return code
ratbag_hidraw_output_report returns 0 on success, not the number of bytes
written.
2018-02-12 12:03:23 +10:00
Thomas Hindoe Paaboel Andersen
3459fab8ec reset LED dirty flag on commit 2018-02-12 12:02:31 +10:00
Thomas Hindoe Paaboel Andersen
8063385d03 steelseries: default button mapping for sensei 310
The default button mapping the sensei 310 does not match
the table for the two known steelseries mice. The 6th button
is no longer resolution cycle, so the single table no longer
fits. Let's construct the table depending on the number of
buttons on the device.
2018-02-07 01:18:20 +01:00
Thomas Hindoe Paaboel Andersen
3dabcaa3a0 steelseries: add sensei 310
Very similar to the rival 310, but with 2 additional buttons
2018-02-07 01:18:20 +01:00
Matthias Gerstner
6c182b8e9b meson/dbus: support build time option to restrict D-Bus access
This change makes it possible to pass '-Ddbus-group=<group>' to limit
the access to the ratbagd D-Bus service. The default remains to allow
everyone access to the service.

This allows integrators to choose more conservative security settings
e.g. only allowing users in the 'games' group to talk to the ratbagd
daemon.
2018-01-29 12:48:30 +10:00
Peter Hutterer
ae805a3568 circleci: update to use Ubuntu 17.10
17.04 is EOL

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-01-19 10:46:56 +01:00
Peter Hutterer
d0001b8e0e circleci: use meson configure rather than mesonconf
This broke with meson 0.44 and results in an error:
RuntimeError: Could not determine how to run Meson. Please file a bug with details.

See https://github.com/mesonbuild/meson/issues/2761

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-01-19 10:46:56 +01:00
Ogier Bouvier
cbcdc4b724 ratbagd: ensure boolean passed to sd_* are 4 bytes wide
fix #433

Signed-off-by: Ogier Bouvier <obouvier@logitech.com>
2017-12-19 10:01:53 +01:00
Peter Hutterer
3bc3da967c meson.build: libratbag 0.9.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
v0.9.901
2017-12-18 13:46:50 +10:00
Peter Hutterer
b50ffef327 meson: require meson version 0.36
For add_project_arguments

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-12-18 13:21:32 +10:00
Ogier Bouvier
ec223eb2e6 hidpp20: force at least one profile to be enabled
fix #428

Signed-off-by: Ogier Bouvier <obouvier@logitech.com>
2017-12-13 15:06:39 +01:00
Ignacio Vazquez-Abrams
573d3d399e Allow meson to skip the test that requires root if root is unavailable 2017-12-04 09:05:09 +10:00
Thomas Hindoe Paaboel Andersen
0f5beb619e steelseries: support cycle and breathing LED mode
To specify the colors to cycle trough we write a list of
colors and their individual share of the total cycle duration.

Solid colors only have a single color in their list.

Breathing mode will cycle to and from the picked color and black.

Cycle mode will cycle through red, green, and blue.
2017-11-27 08:54:06 +10:00
Thomas Hindoe Paaboel Andersen
89aff23c11 use SVGs from the source dir in .devel
When using ratbagctl.devel we would use the .device files
from the source dir. This patch also makes it use the .svg
files from the source dir. This makes it easier to edit the
svg and less surprising now that it follows the .devices files.

To match the source file layout the .devices files are now
installed into a 'devices' subdirectory.
2017-11-25 16:46:50 +01:00
Thomas Hindoe Paaboel Andersen
fd27957b57 steelseries: add a support for the Kinzu V2 2017-11-22 14:35:09 +10:00
Thomas Hindoe Paaboel Andersen
554ee88c86 steelseries: move hardcoded values to .device
The steelseries driver used some hardcoded values for as the
only supported device was the rival 310. This moves that data
to the .device file.

The default resolutions used are changed from hardcoded 1000
and 2000, to the two first entries in the dpi list. Picking
actual values from the specified dpi list or range is safer.
2017-11-22 14:35:09 +10:00
Thomas Hindoe Paaboel Andersen
868d71a08b data: add section for SteelSeries mice
Add a section in the .device files for SteelSeries mice.
The mice cannot be queried and we need to store data for each
device of number of buttons, leds, and dpi list/range. Lastly
a "device version" is added. The latest models use a slightly
different protocol, so we needed something to distinguish them
with.
2017-11-22 14:35:09 +10:00
Jente Hidskes
9b3c33a2fe Convert LED effect rate in Hz to effect duration in ms
As discussed in https://github.com/libratbag/piper/issues/175
2017-11-15 08:53:56 +01:00
Benjamin Tissoires
109cc69da9 circle.yml: fix CI builds
Looks like https://bugzilla.redhat.com/show_bug.cgi?id=1483553 is
the key.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-11-03 19:44:05 +01:00
Thomas Hindoe Paaboel Andersen
113bd4859e steelseries: add writing buttons 2017-10-27 08:35:10 +10:00
Thomas Hindoe Paaboel Andersen
2a2b7487d4 steelseries: init the buttons to defaults 2017-10-26 10:25:56 +10:00
Thomas Hindoe Paaboel Andersen
2b4022dcbf steelseries: set report rate list 2017-10-26 10:25:56 +10:00
Thomas Hindoe Paaboel Andersen
7555cf1607 G300: set DPIs as a fixed list
Set the list of DPIs directly instead of use the _from_range call.

The G300 has few and coarse resolution options. Using the
exponential'ish range is not a good fit for devices with so
few dpis.

The logitech G300 can set:
250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2250, 2500

but piper would offer:
250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750,
800, 850, 900, 950, 1000, 1100, 1200, 1300, 1400, 1500,
1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500

We overpromise by offering more finegrainded options than the
mouse can do and end up with three times as many options than
we should.
2017-10-25 23:21:28 +02:00
Benjamin Tissoires
9c75a7cc7e tools: ratbagctl: add --nocommit
Allows to batch commands for setting multiple parameters at once.

Fixes #399

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-10-25 09:19:24 +02:00
Benjamin Tissoires
0337ae41ab tools: valgrind: shut up some non relevant memory leaks
Fixes #405

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-10-24 08:25:17 +10:00
Peter Hutterer
ff39e67615 Don't install the default theme svgs
No-one appears to be using these and the efforts to create SVGs
go into the GNOME ones (used by piper). Leave them in the git tree in case
someone wants to pick them up but until we have a consumer it's not worth it
installing them.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-23 09:30:09 +02:00
Peter Hutterer
7ba5563eeb meson: silence compiler warning in swig generated files
libratbag@sha/libratbag.c: In function ‘_wrap_error__varargs__’:
libratbag@sha/libratbag.c:6392:3: warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
   error((char const *)arg1,arg2);

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-23 10:19:57 +10:00
Thomas Hindoe Paaboel Andersen
968b9383d3 G300: move LED leader to LEDs layer
It does not seem to make any difference in Piper but let's be
correct anyway
2017-10-20 07:47:48 +10:00
Joshua Strobl
be6c381751 docs: Ensure we also check for python3 sphinx build exec suffixed without a hyphen. 2017-10-20 07:46:12 +10:00
Joshua Strobl
27a0db37d8 Merge Logitech G403 devices files. 2017-10-20 07:37:03 +10:00
Peter Hutterer
5858816b53 hidpp20: fill the led modes from the 8070 effect ids
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-19 09:23:56 +10:00
Peter Hutterer
a1376180b4 hidpp20: check for monochrome only effects in 8070
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-19 09:23:56 +10:00
Peter Hutterer
75d1400206 hidpp20: set the LED caps based on what the device reports
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-19 09:23:56 +10:00
Peter Hutterer
78475a6d15 hidpp20: use the full getInfo request, not just the count
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-19 09:23:56 +10:00
Peter Hutterer
63f93111fb hidpp20: remove unused reg paramater
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-19 09:23:56 +10:00
Benjamin Tissoires
1ea21ed6ce ratbagd: clean up ratbag devices on SIGINT
Or valgrind complains a lot.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-10-18 16:12:44 +02:00
Benjamin Tissoires
18a8fb9651 hidpp20-drv: cleanup hidpp20drv_update_button*
There is no point anymore to have an extra 'action' argument, and make
both type of function look the same.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-10-18 08:25:45 +10:00
Benjamin Tissoires
2e836a40d3 macro: fix memleak, again
action->macro is supposed to be allocated once and stay for the
entire life of the button. However, it was outrageously overwritten
when setting the action. Take some actions and keep the macro action
around.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-10-18 08:25:45 +10:00
Benjamin Tissoires
c09872e589 macro: fix memleak
The group is set but never freed.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-10-18 08:25:45 +10:00
Thomas Hindoe Paaboel Andersen
575b7bce98 add driver and svg for steelseries rival 310
The driver does not yet support button mappings or any
non-solid LED modes.

The device does not support reading out the current
configuration. On probe some default values are used
to get a usable profile.
2017-10-18 00:19:12 +02:00
Thomas Hindoe Paaboel Andersen
3e04abde30 add function to remove capabilites 2017-10-18 00:19:12 +02:00
Thomas Hindoe Paaboel Andersen
790c5e90bd add RATBAG_LED_TYPE_SCROLL_WHEEL 2017-10-18 00:19:12 +02:00
Thomas Hindoe Paaboel Andersen
85a358e07c G9: remove DPI 0 2017-10-18 08:12:27 +10:00
Thomas Hindoe Paaboel Andersen
3af0544421 hidpp10: fix last entry in dpi_list_from_range 2017-10-18 08:12:27 +10:00