29 Commits

Author SHA1 Message Date
Peter Hutterer
1e62916e75 meson.build: libratbag 0.9.902
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 09:49:25 +10:00
David Guglielmi
447c69f034 data/gnome: G502: fix leds position
In Piper utility, leds configuration is inverted for g502 proteus spectrum
2018-05-17 17:14:04 +02:00
Peter Hutterer
fc0ab95087 Require meson 0.38
add_test_setup() was added in 0.38

Fixes #478

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-14 09:01:24 +10:00
Filipe Laíns
7fe4d6f097 libratbag: create list_append method (#474) 2018-04-09 09:47:53 +10:00
FFY00
fa57b417e9 steelseries: add dirty dpi check 2018-04-06 15:34:59 +02:00
FFY00
1aec9c0f54 steelseries: check button dirty flag when setting profile 2018-03-28 15:40:36 +02:00
Thomas Hindoe Paaboel Andersen
d1918a063c steelseries: sleep between messages
Adding the sleep makes the writes to the device more
reliable.
2018-03-26 21:55:55 +02:00
Thomas H. P. Andersen
770dd62b1d hidpp10: fix finding the closest dpi (#463)
value and dpi are unsigned so the delta calculations was wrong when
dpi is larger than than value. Casting to int should be fine for the
expected range of values in those variables.
2018-03-19 10:13:10 +10:00
Thomas H. P. Andersen
b474e76ac2 ratbagd: use correct enum type (#464)
RATBAG_RESOLUTION_CAP_SEPARATE_XY_RESOLUTION is a part of
ratbag_resolution_capability.
2018-03-19 10:12:34 +10:00
Thomas H. P. Andersen
6fa6e18408 meson: use three single quotes for multiline strings (#462)
This is needed for future versions of meson
2018-03-16 16:41:24 +10:00
Faalagorn
8ee19efee9 Rename etekcity device file to Etekcity Scroll Alpha (#461)
The driver is for Etekcity Scroll Alpha, based on the etekcity.svg and https://www.phoronix.com/scan.php?page=news_item&px=Libratbag-Announced
2018-03-08 10:36:17 +10:00
Yanko Kaneti
45282e7bd9 dbus service: use the actual ratbagd service name and not the alias
The alias can be used only when the service is enabled
2018-03-02 15:29:59 +10:00
Thomas Hindoe Paaboel Andersen
54b04ffff8 logitech G300: set LED mode capabilities 2018-02-23 09:18:32 +10:00
Thomas Hindoe Paaboel Andersen
1243d5bb13 steelseries: use macros for key+modifiers 2018-02-22 11:08:46 +01:00
Thomas Hindoe Paaboel Andersen
627fc5054f logitech-g300: use macros for key+modifiers 2018-02-22 11:08:46 +01:00
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
25 changed files with 1522 additions and 79 deletions

View File

@@ -9,7 +9,7 @@ libratbag_references:
command: |
rm -rf build
meson build ${MESON_PARAMS}
mesonconf build
meson configure build
ninja -v -C build ${NINJA_ARGS}
environment:
MESON_PARAMS: --prefix=/usr
@@ -108,7 +108,7 @@ ubuntu_settings: &ubuntu_settings
apt-get install -y software-properties-common
add-apt-repository universe
apt-get update
apt-get install -y tree git gcc g++ pkg-config meson check libudev-dev libevdev-dev libsystemd-dev valgrind python3-gi python3-evdev libglib2.0-dev python3-lxml python3-dev swig
apt-get install -y tree git gcc g++ pkg-config meson check libudev-dev libevdev-dev libsystemd-dev valgrind python3-gi python3-evdev libglib2.0-dev python3-lxml python3-dev swig systemd
- checkout
- *start_dbus
- *build_and_test
@@ -202,10 +202,10 @@ jobs:
<<: *fedora_settings
docker:
- image: fedora:latest
ubuntu_17_04:
ubuntu_17_10:
<<: *ubuntu_settings
docker:
- image: ubuntu:zesty
- image: ubuntu:artful
doc_build:
<<: *doc_build
docker:
@@ -229,7 +229,7 @@ workflows:
- scan_build:
requires:
- fedora_cache
- ubuntu_17_04
- ubuntu_17_10
- fedora_latest:
requires:
- fedora_cache

View File

@@ -1,6 +1,5 @@
# FIXME: which device is this exactly?
[Device]
Name=Etekcity FIXME
Name=Etekcity Scroll Alpha
DeviceMatch=usb:1ea7:4011
Driver=etekcity
Svg=etekcity.svg

View File

@@ -9,3 +9,4 @@ DeviceVersion=1
Buttons=3
Leds=0
DpiList=400;800;1600;3200
MacroLength=0

View File

@@ -9,3 +9,4 @@ DeviceVersion=2
Buttons=6
Leds=2
DpiRange=100:12000@100
MacroLength=1

View File

@@ -0,0 +1,12 @@
[Device]
Name=SteelSeries Rival
DeviceMatch=usb:1038:1384
Driver=steelseries
Svg=steelseries-rival.svg
[Driver/steelseries]
DeviceVersion=1
Buttons=6
Leds=2
DpiRange=50:6500@50
MacroLength=1

View File

@@ -0,0 +1,12 @@
[Device]
Name=SteelSeries Sensei 310
DeviceMatch=usb:1038:1722
Driver=steelseries
Svg=steelseries-sensei310.svg
[Driver/steelseries]
DeviceVersion=2
Buttons=8
Leds=2
DpiRange=100:12000@100
MacroLength=1

View File

@@ -97,7 +97,7 @@
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#babdb6;stroke-width:1;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal" />
<path
style="color:#000000;display:inline;overflow:visible;vector-effect:none;fill:none;fill-opacity:1;stroke:#babdb6;stroke-width:8;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="led1"
id="led0"
sodipodi:type="arc"
sodipodi:cx="-664.05457"
sodipodi:cy="598.10364"
@@ -185,7 +185,7 @@
inkscape:label="#path1120" />
<path
inkscape:connector-curvature="0"
id="led0"
id="led1"
d="m 554.07316,558.40614 18.36886,76.63506 -10.78213,5.31523 z"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#eeeeec;fill-opacity:1;stroke:#babdb6;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
inkscape:label="#path1122" />
@@ -517,7 +517,7 @@
style="display:inline"
transform="translate(-16.168953)">
<g
id="led0-path"
id="led1-path"
inkscape:label="#g417">
<path
sodipodi:nodetypes="cc"
@@ -535,14 +535,14 @@
<rect
inkscape:label="#rect875"
style="color:#000000;text-align:start;display:inline;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
id="led0-leader"
id="led1-leader"
width="1"
height="1"
x="483"
y="220" />
</g>
<g
id="led1-path"
id="led0-path"
inkscape:label="#g412">
<path
inkscape:connector-curvature="0"
@@ -563,7 +563,7 @@
x="483"
height="1"
width="1"
id="led1-leader"
id="led0-leader"
style="color:#000000;text-align:start;display:inline;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round" />
</g>
</g>

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -0,0 +1,443 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="490"
height="490"
viewBox="0 0 129.64583 129.64583"
version="1.1"
id="svg8"
sodipodi:docname="steelseries-rival.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4142136"
inkscape:cx="78.639558"
inkscape:cy="261.77819"
inkscape:document-units="px"
inkscape:current-layer="Device"
inkscape:document-rotation="0"
showgrid="false"
showguides="false"
inkscape:window-width="1920"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
showborder="true"
inkscape:guide-bbox="true"
units="px"
inkscape:snap-global="false"
inkscape:measure-start="241.5,424.5"
inkscape:measure-end="193,423">
<inkscape:grid
type="xygrid"
id="grid78" />
<sodipodi:guide
position="58.722772,112.40709"
orientation="0,1"
id="guide79"
inkscape:locked="false" />
<sodipodi:guide
position="39.611923,100.54373"
orientation="0,1"
id="guide81"
inkscape:locked="false" />
<sodipodi:guide
position="51.756014,88.614617"
orientation="0,1"
id="guide83"
inkscape:locked="false" />
<sodipodi:guide
position="57.778386,76.729167"
orientation="0,1"
id="guide85"
inkscape:locked="false" />
<sodipodi:guide
position="45.047078,64.795712"
orientation="0,1"
inkscape:locked="false"
id="guide87" />
<sodipodi:guide
position="57.646696,52.899321"
orientation="0,1"
id="guide89"
inkscape:locked="false" />
<sodipodi:guide
position="64.031094,118.70775"
orientation="1,0"
id="guide996"
inkscape:locked="false" />
<sodipodi:guide
position="76.729165,115.65599"
orientation="1,0"
id="guide4799"
inkscape:locked="false" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="Device"
inkscape:label="Device"
style="display:inline;opacity:1"
transform="translate(0,-167.35416)">
<path
style="opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.98636663;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 40.966398,178.40384 c 10.128269,-6.06958 13.843202,-5.15315 22.125375,-5.36057 0.815799,-0.022 1.397736,-0.0441 2.213535,-0.0661 7.544908,0.008 16.804302,3.17239 21.130756,6.44865 1.422136,0.452 2.190922,3.57156 3.150036,8.42225 0.859896,4.92786 2.377355,23.3214 3.378944,30.28552 4.289427,17.445 6.148079,21.13233 5.839397,36.23562 0.08155,9.96062 -3.435205,16.37945 -6.88054,22.71347 -4.707536,5.80429 -6.249571,6.86442 -15.801399,10.09956 -7.805208,1.74184 -11.135198,2.13807 -18.278948,0.8372 -6.32795,-1.67569 -10.758421,-3.68269 -14.782617,-8.15118 -2.665941,-4.21879 -4.043454,-12.34041 -3.573015,-23.27668 0.83923,-20.53867 -3.23693,-47.28029 -3.417692,-53.41373 l 0.529166,-14.69573 c 0.23151,-6.33201 2.28507,-9.07943 4.367002,-10.07828 z"
id="path882"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccc" />
<path
sodipodi:type="arc"
style="display:inline;opacity:1;fill:none;fill-opacity:0.39215686;stroke:#babdb6;stroke-width:3.62082291;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="led0"
sodipodi:cx="64.507607"
sodipodi:cy="278.93338"
sodipodi:rx="6.5174346"
sodipodi:ry="6.5174408"
d="m 69.116129,274.32485 a 6.5174346,6.5174408 0 0 1 0,9.21706 6.5174346,6.5174408 0 0 1 -9.217044,0 6.5174346,6.5174408 0 0 1 -10e-7,-9.21706"
sodipodi:start="5.4977871"
sodipodi:end="3.9269907"
sodipodi:open="true"
sodipodi:arc-type="arc"
inkscape:label="#led1" />
<path
style="display:inline;opacity:1;fill:none;stroke:#babdb6;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 63.998032,175.33704 c -0.0617,17.18181 0,37.8177 0,37.8177 v 0"
id="path4530-9"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
<rect
style="display:inline;opacity:1;fill:#eeeeec;fill-opacity:1;stroke:#bfc2bb;stroke-width:0.65934163;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="button2"
width="8.6572962"
height="16.992365"
x="59.667027"
y="183.8551"
ry="1.5045637"
inkscape:label="#rect4615"
rx="2.8998742" />
<rect
style="display:inline;opacity:1;fill:#d3d3ce;fill-opacity:1;stroke:#bfc2bb;stroke-width:0.50999999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="button5"
width="4.0773749"
height="11.664907"
x="61.934288"
y="213.306"
ry="0.74915975"
inkscape:label="#rect4615"
rx="0.63142258" />
<path
style="opacity:1;fill:#eeeeec;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.65934163;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 91.112176,226.98205 c -0.763945,13.64188 -1.430609,13.74737 0,20.39268 0.486529,2.25997 1.696179,5.2841 2.85379,6.32088 1.157611,1.03679 1.081149,0.34438 4.589061,0.89006 0.940243,-6.53749 -0.570931,-13.96226 -1.479399,-18.97414 -1.652616,-7.76419 -2.041209,-9.76648 -4.816357,-19.91603 -0.935218,-0.0567 -1.141827,10.22026 -1.147095,11.28655 z"
id="path959"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cascccc" />
<path
style="opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 38.306404,179.27446 c 6.240372,-5.59743 15.089504,-6.58952 25.788485,-6.52355 0.06236,2.93106 -0.208006,8.1177 -0.145616,11.04875 -0.966626,0.0156 -1.617539,-0.0389 -2.677709,0.15206 -0.576857,0.12082 -1.668207,0.59244 -1.683798,1.44993 0.03118,4.73958 0.06237,9.47916 0.09355,14.21874 0.428974,0.80223 0.791803,1.0753 1.683798,1.21608 h 2.666014 c 0.09354,3.89768 -0.04677,7.79536 0.04677,11.69304 -1.777343,0.0624 -3.554686,0.12473 -5.332029,0.18709 -4.677216,3.30523 -9.354432,6.6104 -14.031648,9.91563 -1.948383,1.15278 -2.949891,1.59818 -7.302533,1.7394 -0.830377,-6.12609 -3.925564,-39.29473 0.894716,-45.09717 z"
id="button0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccc"
inkscape:label="#path971" />
<path
style="display:inline;opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 87.229344,179.65609 c -8.975635,-7.54404 -14.108253,-6.88035 -22.922173,-6.91425 -0.06236,2.93106 0.0077,8.08746 -0.05466,11.01851 0.966626,0.0156 1.617539,-0.0389 2.677709,0.15206 0.576857,0.12082 1.668207,0.59244 1.683798,1.44993 -0.03118,4.73958 -0.06237,9.47916 -0.09355,14.21874 -0.428974,0.80223 -0.791803,1.0753 -1.683798,1.21608 h -2.80633 c -0.09354,3.89768 0.187088,7.79536 0.09354,11.69304 1.777343,0.0624 3.554686,0.12473 5.332029,0.18709 4.677216,3.30523 9.050413,6.64971 13.72763,9.95494 2.182243,-0.0165 4.486808,-0.13974 7.992488,-0.15492 2.289604,-8.17688 -1.912326,-39.03947 -3.946687,-42.82126 z"
id="button1"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccc"
inkscape:label="#path971-5" />
<path
style="opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 39.533701,248.31208 c 0.08789,-9.75637 -0.210156,-12.40005 -1.249267,-23.97153 -0.755908,0.011 0.02246,0.0448 -1.253567,0.0612 l 1.730229,23.94557 c 0.618261,-0.0306 -0.0064,-0.0352 0.772605,-0.0352 z"
id="button3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccc"
inkscape:label="#path998" />
<path
style="opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 38.039569,223.41713 -1.173721,-0.46275 -1.223702,-11.3646 0.83829,-1.79053 z"
id="button4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
inkscape:label="#path1000" />
<g
id="g27"
inkscape:label="#g84"
style="opacity:1">
<path
inkscape:label="#path42"
inkscape:connector-curvature="0"
id="led1"
d="m 60.202463,185.20746 c 0,14.31228 0,14.31228 0,14.31228"
style="fill:#c8c8c8;fill-opacity:1;stroke:#babdb6;stroke-width:0.23228861px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:label="#path42"
inkscape:connector-curvature="0"
id="led0-3"
d="m 67.749483,185.21452 c 0,14.31228 0,14.31228 0,14.31228"
style="display:inline;opacity:1;fill:#c8c8c8;fill-opacity:1;stroke:#babdb6;stroke-width:0.23228861px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<path
style="fill:none;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.50999999;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 63.937548,224.94747 v 9.40121"
id="path951"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</g>
<g
inkscape:groupmode="layer"
id="Buttons"
inkscape:label="Buttons"
transform="translate(0,-2.6458338)"
style="display:inline">
<g
transform="matrix(-0.29294531,0,0,0.26458333,70.19679,-46.28282)"
style="display:inline"
id="button0-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 69.018882,250.50576 170.100828,0.008"
id="path966"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976"
width="6.999999"
height="6.999999"
x="65.211685"
y="247.25577" />
<rect
y="250.01747"
x="238.66302"
height="1"
width="1"
id="button0-leader"
style="color:#000000;text-align:end;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
<g
transform="matrix(0.26458333,0,0,0.26458333,40.502648,-25.152234)"
style="display:inline"
id="button1-path"
inkscape:label="#g146">
<path
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:0.99999994;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 336.41912,170.11088 -197.26264,0.0828"
id="path51"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect53"
width="6.999999"
height="6.999999"
x="137"
y="166.75" />
<rect
y="169.61206"
x="335.92694"
height="1"
width="1"
id="button1-leader"
style="color:#000000;text-align:start;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect871" />
</g>
<g
transform="matrix(0.26458333,0,0,0.26458333,39.927878,-13.516602)"
style="display:inline"
id="button2-path"
inkscape:label="#g146">
<path
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:0.99999994;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="M 338.62224,171.07963 91.069203,171.06803"
id="path51-2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect53-3"
width="6.999999"
height="6.999999"
x="87.596474"
y="167.57452" />
<rect
y="170.56519"
x="338.10663"
height="1"
width="1"
id="button2-leader"
style="color:#000000;text-align:start;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect871" />
</g>
<g
transform="matrix(0.26458333,0,0,0.26458333,39.855422,10.357346)"
style="display:inline"
id="button5-path"
inkscape:label="#g146">
<path
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:0.99999994;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="M 338.91912,170.14213 91.343981,170.50618"
id="path51-2-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect53-3-4"
width="6.999999"
height="6.999999"
x="88"
y="167.375" />
<rect
y="169.65894"
x="338.32538"
height="1"
width="1"
id="button5-leader"
style="color:#000000;text-align:start;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect871" />
</g>
<g
transform="matrix(-0.29294531,0,0,0.26458333,70.354375,-10.600792)"
style="display:inline"
id="button4-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 113.69984,250.59415 125.92438,-0.0532"
id="path966-1"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976-3"
width="6.999999"
height="6.999999"
x="110.07652"
y="247.06827" />
<rect
y="250.06044"
x="239.16049"
height="1"
width="1"
id="button4-leader"
style="color:#000000;text-align:end;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
<g
transform="matrix(-0.29294531,0,0,0.26458333,70.260832,1.1857932)"
style="display:inline"
id="button3-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 109.05947,250.54995 130.56475,-0.009"
id="path966-2"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976-8"
width="6.999999"
height="6.999999"
x="105.5442"
y="247.06068" />
<rect
y="250.00575"
x="238.62422"
height="1"
width="1"
id="button3-leader"
style="color:#000000;text-align:end;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="LEDs"
inkscape:label="LEDs"
transform="translate(0,-2.6458338)"
style="display:inline">
<g
transform="matrix(-0.29294531,0,0,0.26458333,69.912779,-34.520744)"
style="display:inline"
id="led1-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 33.260958,250.40632 204.900782,0.0964"
id="path966-0"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976-2"
width="6.999999"
height="6.999999"
x="29.527279"
y="246.99062" />
<rect
y="249.97328"
x="237.64519"
height="1"
width="1"
id="led1-leader"
style="color:#000000;text-align:end;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
<g
transform="matrix(-0.29294531,0,0,0.26458333,69.953208,49.201431)"
style="display:inline"
id="led0-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 19.28901,250.49471 219.01243,0.008"
id="path966-0-2"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976-2-1"
width="6.999999"
height="6.999999"
x="16.834169"
y="246.63705" />
<rect
y="249.97328"
x="237.7849"
height="1"
width="1"
id="led0-leader"
style="color:#000000;text-align:end;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -0,0 +1,513 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="490"
height="490"
viewBox="0 0 129.64583 129.64583"
version="1.1"
id="svg8"
sodipodi:docname="steelseries-sensei310.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="251.39478"
inkscape:cy="163.59644"
inkscape:document-units="px"
inkscape:current-layer="Buttons"
inkscape:document-rotation="0"
showgrid="false"
showguides="false"
inkscape:window-width="1920"
inkscape:window-height="1163"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
showborder="true"
inkscape:guide-bbox="true"
units="px"
inkscape:snap-global="false"
inkscape:measure-start="-166.877,108.894"
inkscape:measure-end="135.057,119.501">
<inkscape:grid
type="xygrid"
id="grid78" />
<sodipodi:guide
position="58.722772,112.40709"
orientation="0,1"
id="guide79"
inkscape:locked="false" />
<sodipodi:guide
position="39.611923,100.54373"
orientation="0,1"
id="guide81"
inkscape:locked="false" />
<sodipodi:guide
position="51.756014,88.614617"
orientation="0,1"
id="guide83"
inkscape:locked="false" />
<sodipodi:guide
position="57.778386,76.729167"
orientation="0,1"
id="guide85"
inkscape:locked="false" />
<sodipodi:guide
position="45.047078,64.795712"
orientation="0,1"
inkscape:locked="false"
id="guide87" />
<sodipodi:guide
position="57.646696,52.899321"
orientation="0,1"
id="guide89"
inkscape:locked="false" />
<sodipodi:guide
position="64.029165,118.70775"
orientation="1,0"
id="guide996"
inkscape:locked="true"
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
<sodipodi:guide
position="76.729165,115.65599"
orientation="1,0"
id="guide4799"
inkscape:locked="false" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="Device"
inkscape:label="Device"
style="display:inline;opacity:1"
transform="translate(0,-167.35416)">
<path
style="opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.98636663;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 39.422916,178.73125 c 8.753298,-5.1263 8.742273,-5.15937 19.909893,-6.35 0.86322,1.81872 1.399035,2.16412 3.571875,2.57968 0.815799,-0.022 1.631597,-0.0441 2.447396,-0.0661 1.808025,-0.44162 2.142728,-0.67277 3.108854,-2.4474 11.230355,1.36029 11.188618,1.38757 18.25625,6.74688 2.745052,3.1309 3.671094,5.00504 4.365625,8.59896 0.264583,5.1263 1.254823,10.38485 1.320969,15.47808 l 2.184761,4.89479 v 17.19791 l -2.513542,0.99224 10e-7,1.52135 2.513541,0.39687 c -1.007974,11.0006 -2.00013,19.52446 -2.182812,28.97188 -0.57326,10.05417 -0.800418,19.72432 -6.813021,26.64427 -3.502949,4.03157 -9.595838,4.97222 -14.816666,6.09791 -4.39946,0.94859 -9.075269,1.31864 -13.493752,0.46302 -5.302922,-1.02689 -11.328135,-2.43714 -14.816664,-6.56093 -5.920645,-6.99879 -4.641232,-18.97136 -6.81302,-26.64427 -0.782726,-9.55807 -1.367014,-19.31459 -2.050521,-28.97188 l 2.38125,-0.39687 c -0.0441,-0.50712 -0.08819,-1.01423 -0.132292,-1.52135 l -2.38125,-0.99224 v -17.19791 c 0.617361,-1.6316 1.234723,-3.26319 1.852084,-4.89479 l 0.926041,-18.19006 c 0.496094,-3.10887 1.256771,-4.69638 3.175,-6.35004 z"
id="path882"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccaaaaccccccccc" />
<path
sodipodi:type="arc"
style="display:inline;opacity:1;fill:none;fill-opacity:0.39215686;stroke:#babdb6;stroke-width:3.62082291;stroke-linecap:square;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="led0"
sodipodi:cx="64.507607"
sodipodi:cy="278.93338"
sodipodi:rx="6.5174346"
sodipodi:ry="6.5174408"
d="m 69.116129,274.32485 a 6.5174346,6.5174408 0 0 1 0,9.21706 6.5174346,6.5174408 0 0 1 -9.217044,0 6.5174346,6.5174408 0 0 1 -10e-7,-9.21706"
sodipodi:start="5.4977871"
sodipodi:end="3.9269907"
sodipodi:open="true"
sodipodi:arc-type="arc"
inkscape:label="#led1" />
<path
style="display:inline;opacity:1;fill:none;stroke:#babdb6;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 63.998032,175.33704 c -0.0617,17.18181 0,37.8177 0,37.8177 v 0"
id="path4530-9"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
<rect
style="display:inline;opacity:1;fill:#eeeeec;fill-opacity:1;stroke:#bfc2bb;stroke-width:0.65934163;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="button2"
width="8.6572962"
height="16.992365"
x="59.667027"
y="183.8551"
ry="1.5045637"
inkscape:label="#rect4615"
rx="2.8998742" />
<rect
style="display:inline;opacity:1;fill:#d3d3ce;fill-opacity:1;stroke:#bfc2bb;stroke-width:0.51011664;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="button7"
width="4.0773749"
height="11.664907"
x="61.934288"
y="213.306"
ry="0.74915975"
inkscape:label="#rect4615"
rx="0.63142258" />
<path
style="opacity:1;fill:#eeeeec;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.65934163;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 37.140885,265.81223 c 1.378038,-1.69774 2.359202,-2.7671 2.910417,-4.69635 0.275607,-1.59853 0.319704,-2.27101 0.132291,-3.70417 l -0.529166,-2.91042 c -0.352778,0.022 -0.705556,0.0441 -1.058334,0.0661 -1.113455,-0.31971 -1.631597,-0.93707 -2.248958,-1.65365 -0.429948,-0.89297 -0.859896,-1.78593 -1.289844,-2.6789 l 0.529167,6.91224 z"
id="path961"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccc" />
<path
style="opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 39.662795,224.50314 c -1.418755,-15.53616 -1.294028,-30.04332 -0.748352,-45.27546 7.464057,-5.23848 10.578303,-5.75298 20.392662,-7.01583 0.604141,2.15932 2.552981,2.88039 4.583673,2.89988 0.06236,2.93106 -0.0039,5.75688 0.05847,8.68793 -0.966626,0.0156 -1.617539,-0.0389 -2.677709,0.15206 -0.576857,0.12082 -1.668207,0.59244 -1.683798,1.44993 0.03118,4.73958 0.06237,9.47916 0.09355,14.21874 0.428974,0.80223 0.791803,1.0753 1.683798,1.21608 h 2.666014 c 0.09354,3.89768 -0.04677,7.79536 0.04677,11.69304 -1.777343,0.0624 -3.554686,0.12473 -5.332029,0.18709 -4.677216,3.30523 -9.354432,6.61047 -14.031648,9.9157 -1.948383,1.15278 -3.036871,1.77639 -5.051401,1.87084 z"
id="button0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccc"
inkscape:label="#path971" />
<path
style="display:inline;opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 88.538966,224.46383 c 1.418756,-15.53616 -0.763946,-29.5756 -1.309622,-44.80774 -6.341526,-5.61266 -8.520329,-6.2207 -18.334688,-7.48355 -0.604141,2.15932 -2.833614,2.83362 -4.864306,2.85311 -0.06236,2.93106 0.284533,5.80365 0.222163,8.7347 0.966626,0.0156 1.617539,-0.0389 2.677709,0.15206 0.576857,0.12082 1.668207,0.59244 1.683798,1.44993 -0.03118,4.73958 -0.06237,9.47916 -0.09355,14.21874 -0.428974,0.80223 -0.791803,1.0753 -1.683798,1.21608 h -2.80633 c -0.09354,3.89768 0.187088,7.79536 0.09354,11.69304 1.777343,0.0624 3.554686,0.12473 5.332029,0.18709 4.677216,3.30523 9.354432,6.61047 14.031649,9.9157 1.948382,1.15278 3.036871,1.77639 5.0514,1.87084 z"
id="button1"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccccccccc"
inkscape:label="#path971-5" />
<path
style="opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 39.721262,254.48409 c -2.127995,-12.76601 -2.492187,-15.11204 -3.531298,-26.68352 -0.880877,0.16371 -1.761753,0.32741 -2.64263,0.49111 0.510597,7.26528 1.021194,14.53055 1.531791,21.79583 0.415673,1.21059 0.673654,1.8504 1.39147,2.98173 0.557369,0.65481 1.067966,1.08745 1.882582,1.5084 0.738934,0.12313 0.851361,0.031 1.368085,-0.0935 z"
id="button3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
inkscape:label="#path998" />
<path
style="opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 36.061341,226.30387 -2.595857,-0.95884 v -17.51617 l 2.128134,-4.89938 z"
id="button4"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
inkscape:label="#path1000" />
<g
id="g27"
inkscape:label="#g84"
style="opacity:1">
<path
inkscape:label="#path42"
inkscape:connector-curvature="0"
id="led1"
d="m 60.202463,185.20746 c 0,14.31228 0,14.31228 0,14.31228"
style="fill:#c8c8c8;fill-opacity:1;stroke:#babdb6;stroke-width:0.23228861px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:label="#path42"
inkscape:connector-curvature="0"
id="led0-3"
d="m 67.749483,185.21452 c 0,14.31228 0,14.31228 0,14.31228"
style="display:inline;opacity:1;fill:#c8c8c8;fill-opacity:1;stroke:#babdb6;stroke-width:0.23228861px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
<path
style="display:inline;opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 91.839114,226.13585 2.59586,-0.95884 v -17.51617 l -2.12814,-4.89938 z"
id="button6"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
inkscape:label="#path1000" />
<path
style="display:inline;opacity:1;fill:#eeeeec;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.65934163;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 91.651856,265.50364 c -1.378038,-1.69774 -3.25217,-2.70095 -3.803385,-4.6302 -0.275607,-1.59853 -0.319704,-2.27101 -0.132291,-3.70417 l 0.529166,-2.91042 c 0.352778,0.022 0.705556,0.0441 1.058334,0.0661 1.113455,-0.31971 1.631597,-0.93707 2.248958,-1.65365 0.429948,-0.89297 0.859896,-1.78593 1.289844,-2.6789 l -0.529167,6.91224 z"
id="path961-7"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccc" />
<path
style="display:inline;opacity:1;fill:#d3d3ce;fill-opacity:1;fill-rule:evenodd;stroke:#bfc2bb;stroke-width:0.51011664;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 88.31891,254.33178 c 2.127995,-12.76601 2.492187,-15.11204 3.531298,-26.68352 0.880877,0.16371 1.761753,0.32741 2.64263,0.49111 -0.510597,7.26528 -1.021194,14.53055 -1.531791,21.79583 -0.415673,1.21059 -0.673654,1.8504 -1.39147,2.98173 -0.557369,0.65481 -1.067966,1.08745 -1.882582,1.5084 -0.738934,0.12313 -0.851361,0.031 -1.368085,-0.0935 z"
id="button5"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
inkscape:label="#path998" />
</g>
<g
inkscape:groupmode="layer"
id="Buttons"
inkscape:label="Buttons"
transform="translate(0,-2.6458338)"
style="display:inline">
<g
transform="matrix(-0.29294531,0,0,0.26458333,70.19679,-46.28282)"
style="display:inline"
id="button0-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 69.018882,250.50576 170.100828,0.008"
id="path966"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976"
width="6.999999"
height="6.999999"
x="65.211685"
y="247.25577" />
<rect
y="250.01747"
x="238.66302"
height="1"
width="1"
id="button0-leader"
style="color:#000000;text-align:end;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
<g
transform="matrix(0.26458333,0,0,0.26458333,40.502648,-25.152234)"
style="display:inline"
id="button1-path"
inkscape:label="#g146">
<path
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:0.99999994;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 336.41912,170.11088 -197.26264,0.0828"
id="path51"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect53"
width="6.999999"
height="6.999999"
x="137"
y="166.75" />
<rect
y="169.61206"
x="335.92694"
height="1"
width="1"
id="button1-leader"
style="color:#000000;text-align:start;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect871" />
</g>
<g
transform="matrix(0.26458333,0,0,0.26458333,39.927878,-13.516602)"
style="display:inline"
id="button2-path"
inkscape:label="#g146">
<path
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:0.99999994;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="M 338.62224,171.07963 91.069203,171.06803"
id="path51-2"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect53-3"
width="6.999999"
height="6.999999"
x="87.596474"
y="167.57452" />
<rect
y="170.56519"
x="338.10663"
height="1"
width="1"
id="button2-leader"
style="color:#000000;text-align:start;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect871" />
</g>
<g
transform="matrix(0.26458333,0,0,0.26458333,39.855422,10.357346)"
style="display:inline"
id="button7-path"
inkscape:label="#g146">
<path
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:0.99999994;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="M 339.97978,126.30151 139.89299,126.07359 91.343981,170.50618"
id="path51-2-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect53-3-4"
width="6.999999"
height="6.999999"
x="88"
y="167.375" />
<rect
y="125.46475"
x="338.41376"
height="1"
width="1"
id="button7-leader"
style="color:#000000;text-align:start;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect871" />
</g>
<g
transform="matrix(-0.29294531,0,0,0.26458333,70.354375,-10.600792)"
style="display:inline"
id="button4-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 121.40352,250.50576 118.2207,0.0352"
id="path966-1"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976-3"
width="6.999999"
height="6.999999"
x="118.01969"
y="247.06827" />
<rect
y="250.06044"
x="239.16049"
height="1"
width="1"
id="button4-leader"
style="color:#000000;text-align:end;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
<g
transform="matrix(-0.29294531,0,0,0.26458333,70.260832,1.1857932)"
style="display:inline"
id="button3-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 119.59715,250.50576 120.02707,0.0352"
id="path966-2"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976-8"
width="6.999999"
height="6.999999"
x="116.24155"
y="247.19327" />
<rect
y="250.00575"
x="238.62422"
height="1"
width="1"
id="button3-leader"
style="color:#000000;text-align:end;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
<g
transform="matrix(0.29294531,0,0,0.26458333,57.669203,-10.667542)"
style="display:inline"
id="button6-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="M 121.40352,250.50576 245.2523,250.36418"
id="path966-1-56"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976-3-2"
width="6.999999"
height="6.999999"
x="118.01969"
y="247.06827" />
<rect
y="249.93338"
x="244.75864"
height="1"
width="1"
id="button6-leader"
style="color:#000000;text-align:start;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
<g
transform="matrix(0.29294531,0,0,0.26458333,57.642982,1.1725622)"
style="display:inline"
id="button5-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="M 121.40352,250.50576 245.2523,250.36418"
id="path966-1-56-2"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976-3-2-7"
width="6.999999"
height="6.999999"
x="116.50291"
y="247.24504" />
<rect
y="249.93338"
x="244.75864"
height="1"
width="1"
id="button5-leader"
style="color:#000000;text-align:start;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="LEDs"
inkscape:label="LEDs"
transform="translate(0,-2.6458338)"
style="display:inline">
<g
transform="matrix(-0.29294531,0,0,0.26458333,69.912779,-34.520744)"
style="display:inline"
id="led1-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 33.260958,250.40632 204.900782,0.0964"
id="path966-0"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976-2"
width="6.999999"
height="6.999999"
x="29.527279"
y="246.99062" />
<rect
y="249.97328"
x="237.64519"
height="1"
width="1"
id="led1-leader"
style="color:#000000;text-align:end;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
<g
transform="matrix(-0.29294531,0,0,0.26458333,69.953208,49.201431)"
style="display:inline"
id="led0-path"
inkscape:label="#g156">
<path
sodipodi:nodetypes="cc"
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:#888a85;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
d="m 19.28901,250.49471 219.01243,0.008"
id="path966-0-2"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;overflow:visible;opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"
id="rect976-2-1"
width="6.999999"
height="6.999999"
x="16.834169"
y="246.63705" />
<rect
y="249.97328"
x="237.7849"
height="1"
width="1"
id="led0-leader"
style="color:#000000;text-align:end;overflow:visible;vector-effect:none;fill:#888a85;fill-opacity:1;stroke:none;stroke-linecap:round"
inkscape:label="#rect875" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -11,8 +11,7 @@
<allow receive_sender="org.freedesktop.ratbag1"/>
</policy>
<!-- allow everyone to talk to the daemon -->
<policy context="default">
<policy @access@>
<allow send_destination="org.freedesktop.ratbag1"/>
<allow receive_sender="org.freedesktop.ratbag1"/>
</policy>

View File

@@ -2,4 +2,4 @@
Name=org.freedesktop.ratbag1
Exec=@bindir@/ratbagd
User=root
SystemdService=dbus-org.freedesktop.ratbag1.service
SystemdService=ratbagd.service

View File

@@ -1,8 +1,8 @@
project('libratbag', 'c', 'cpp',
version : '0.9.901',
version : '0.9.902',
license : 'MIT/Expat',
default_options : [ 'c_std=gnu99', 'warning_level=2' ],
meson_version : '>= 0.36.0')
meson_version : '>= 0.38.0')
libratbag_version = meson.project_version().split('.')
@@ -242,7 +242,7 @@ man_lur_command = configure_file (
#### data files ####
data_files = files(
'data/devices/etekcity-fixme.device',
'data/devices/etekcity-scroll-alpha.device',
'data/devices/gskill-MX-780.device',
'data/devices/logitech-g300.device',
'data/devices/logitech-g303.device',
@@ -274,6 +274,7 @@ data_files = files(
'data/devices/roccat-kone-xtd.device',
'data/devices/steelseries-kinzu-v2.device',
'data/devices/steelseries-rival-310.device',
'data/devices/steelseries-sensei-310.device',
)
install_data(data_files,
@@ -301,6 +302,7 @@ gnome_svg_files = files(
'data/gnome/roccat-kone-xtd.svg',
'data/gnome/steelseries-kinzu-v2.svg',
'data/gnome/steelseries-rival310.svg',
'data/gnome/steelseries-sensei310.svg',
)
install_data(gnome_svg_files,
install_dir : join_paths(get_option('datadir'), 'libratbag', 'gnome'))
@@ -436,14 +438,14 @@ if unitdir == ''
# works out of the box.
intended_unitdir = join_paths(get_option('prefix'), get_option('libdir'), 'systemd')
if get_option('prefix') == '/usr' and intended_unitdir != default_unitdir
message('
message('''
systemd unitdir libdir mismatch detected, changing unitdir to
@0@
or specify with
mesonconf -Dsystemd-unit-dir=<path>
See https://github.com/libratbag/libratbag/issues/188
'.format(default_unitdir))
'''.format(default_unitdir))
unitdir = default_unitdir
else
unitdir = intended_unitdir
@@ -467,8 +469,23 @@ configure_file(input : 'dbus/org.freedesktop.ratbag1.service.in',
output : 'org.freedesktop.ratbag1.service',
configuration : config_bindir,
install_dir : join_paths(dbusdir, 'system-services'))
install_data('dbus/org.freedesktop.ratbag1.conf',
install_dir : join_paths(dbusdir, 'system.d'))
dbusgroup = get_option('dbus-group')
if dbusgroup == ''
# grant everybody access by default
access = 'context="default"'
else
# grant access to members of the specified group only
access = 'group="@0@"'.format(dbusgroup)
endif
config_dbusaccess = configuration_data()
config_dbusaccess.set('access', access)
configure_file(input : 'dbus/org.freedesktop.ratbag1.conf.in',
output : 'org.freedesktop.ratbag1.conf',
configuration : config_dbusaccess,
install_dir : join_paths(dbusdir, 'system.d'))
#### tools ####

View File

@@ -22,3 +22,8 @@ option('documentation',
type: 'boolean',
value: false,
description: 'Enable documentation build (default=no)')
option('dbus-group',
type: 'string',
value : '',
description : 'The UNIX group that is granted access to the ratbagd D-Bus service. By default all users may access it.')

View File

@@ -196,7 +196,7 @@ static int ratbagd_profile_is_active(sd_bus *bus,
sd_bus_error *error)
{
struct ratbagd_profile *profile = userdata;
bool is_active;
int is_active;
is_active = !!ratbag_profile_is_active(profile->lib_profile);
@@ -315,7 +315,7 @@ ratbagd_profile_set_enabled(sd_bus *bus,
sd_bus_error *error)
{
struct ratbagd_profile *profile = userdata;
bool enabled;
int enabled;
int r;
r = sd_bus_message_read(m, "b", &enabled);
@@ -345,7 +345,7 @@ ratbagd_profile_is_enabled(sd_bus *bus,
sd_bus_error *error)
{
struct ratbagd_profile *profile = userdata;
bool enabled = ratbag_profile_is_enabled(profile->lib_profile) != 0;
int enabled = ratbag_profile_is_enabled(profile->lib_profile) != 0;
return sd_bus_message_append(reply, "b", enabled);
}

View File

@@ -165,7 +165,7 @@ ratbagd_resolution_is_active(sd_bus *bus,
{
struct ratbagd_resolution *resolution = userdata;
struct ratbag_resolution *lib_resolution = resolution->lib_resolution;
bool is_active;
int is_active;
is_active = !!ratbag_resolution_is_active(lib_resolution);
@@ -183,7 +183,7 @@ ratbagd_resolution_is_default(sd_bus *bus,
{
struct ratbagd_resolution *resolution = userdata;
struct ratbag_resolution *lib_resolution = resolution->lib_resolution;
bool is_default;
int is_default;
is_default = !!ratbag_resolution_is_default(lib_resolution);
@@ -252,7 +252,7 @@ ratbagd_resolution_set_resolution(sd_bus *bus,
{
struct ratbagd_resolution *resolution = userdata;
struct ratbag_resolution *lib_resolution = resolution->lib_resolution;
const enum ratbag_device_capability cap = RATBAG_RESOLUTION_CAP_SEPARATE_XY_RESOLUTION;
const enum ratbag_resolution_capability cap = RATBAG_RESOLUTION_CAP_SEPARATE_XY_RESOLUTION;
int xres, yres;
int r;

View File

@@ -151,6 +151,54 @@ logitech_g300_raw_to_button_action(uint8_t data)
return NULL;
}
static uint8_t logitech_g300_modifier_to_raw(int modifier_flags)
{
uint8_t modifiers = 0x00;
if (modifier_flags & MODIFIER_LEFTCTRL)
modifiers |= 0x01;
if (modifier_flags & MODIFIER_LEFTSHIFT)
modifiers |= 0x02;
if (modifier_flags & MODIFIER_LEFTALT)
modifiers |= 0x04;
if (modifier_flags & MODIFIER_LEFTMETA)
modifiers |= 0x08;
if (modifier_flags & MODIFIER_RIGHTCTRL)
modifiers |= 0x10;
if (modifier_flags & MODIFIER_RIGHTSHIFT)
modifiers |= 0x20;
if (modifier_flags & MODIFIER_RIGHTALT)
modifiers |= 0x40;
if (modifier_flags & MODIFIER_RIGHTMETA)
modifiers |= 0x80;
return modifiers;
}
static int logitech_g300_raw_to_modifiers(uint8_t data)
{
int modifiers = 0;
if (data & 0x01)
modifiers |= MODIFIER_LEFTCTRL;
if (data & 0x02)
modifiers |= MODIFIER_LEFTSHIFT;
if (data & 0x04)
modifiers |= MODIFIER_LEFTALT;
if (data & 0x08)
modifiers |= MODIFIER_LEFTMETA;
if (data & 0x10)
modifiers |= MODIFIER_RIGHTCTRL;
if (data & 0x20)
modifiers |= MODIFIER_RIGHTSHIFT;
if (data & 0x40)
modifiers |= MODIFIER_RIGHTALT;
if (data & 0x80)
modifiers |= MODIFIER_RIGHTMETA;
return modifiers;
}
static uint8_t
logitech_g300_button_action_to_raw(const struct ratbag_button_action *action)
{
@@ -307,6 +355,7 @@ logitech_g300_read_button(struct ratbag_button *button)
ratbag_button_enable_action_type(button, RATBAG_BUTTON_ACTION_TYPE_BUTTON);
ratbag_button_enable_action_type(button, RATBAG_BUTTON_ACTION_TYPE_SPECIAL);
ratbag_button_enable_action_type(button, RATBAG_BUTTON_ACTION_TYPE_KEY);
ratbag_button_enable_action_type(button, RATBAG_BUTTON_ACTION_TYPE_MACRO);
button->type = logitech_g300_raw_to_button_type(button->index);
@@ -316,11 +365,20 @@ logitech_g300_read_button(struct ratbag_button *button)
}
else if (button_report->code == 0x00 && (button_report->modifier > 0x00 || button_report->key > 0x00))
{
struct ratbag_button_action *key_action = &button->action;
unsigned int key, modifiers;
int rc;
key_action->type = RATBAG_BUTTON_ACTION_TYPE_KEY;
key_action->action.key.key = ratbag_hidraw_get_keycode_from_keyboard_usage(
device, button_report->key);
key = ratbag_hidraw_get_keycode_from_keyboard_usage(device,
button_report->key);
modifiers = logitech_g300_raw_to_modifiers(button_report->modifier);
rc = ratbag_button_macro_new_from_keycode(button, key, modifiers);
if (rc < 0) {
log_error(device->ratbag,
"Error while reading button %d\n",
button->index);
button->action.type = RATBAG_BUTTON_ACTION_TYPE_NONE;
}
}
}
@@ -342,6 +400,8 @@ logitech_g300_read_led(struct ratbag_led *led)
led->color.red = profile_report->led_red * 255;
led->color.green = profile_report->led_green * 255;
led->color.blue = profile_report->led_blue * 255;
ratbag_led_set_mode_capability(led, RATBAG_LED_OFF);
ratbag_led_set_mode_capability(led, RATBAG_LED_ON);
}
static void
@@ -444,6 +504,7 @@ logitech_g300_probe(struct ratbag_device *device)
ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_SWITCHABLE_PROFILE);
ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON);
ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON_KEY);
ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON_MACROS);
active_idx = logitech_g300_get_active_profile_and_resolution(device);
@@ -517,9 +578,22 @@ logitech_g300_write_profile(struct ratbag_profile *profile)
raw_button->code = logitech_g300_button_action_to_raw(action);
raw_button->modifier = 0x00;
raw_button->key = 0x00;
if (action->type == RATBAG_BUTTON_ACTION_TYPE_KEY) {
if (action->type == RATBAG_BUTTON_ACTION_TYPE_MACRO) {
unsigned int key, modifiers;
rc = ratbag_action_keycode_from_macro(action,
&key,
&modifiers);
if (rc < 0) {
log_error(device->ratbag,
"Error while writing macro for button %d\n",
button->index);
}
raw_button->key = ratbag_hidraw_get_keyboard_usage_from_keycode(
device, action->action.key.key);
device, key);
raw_button->modifier = logitech_g300_modifier_to_raw(modifiers);
}
}

View File

@@ -48,6 +48,8 @@
#define STEELSERIES_ID_DPI_SHORT 0x03
#define STEELSERIES_ID_REPORT_RATE_SHORT 0x04
#define STEELSERIES_ID_LED_EFFECT_SHORT 0x07
#define STEELSERIES_ID_LED_COLOR_SHORT 0x08
#define STEELSERIES_ID_SAVE_SHORT 0x09
#define STEELSERIES_ID_BUTTONS 0x31
@@ -63,26 +65,6 @@
#define STEELSERIES_BUTTON_KBD 0x51
#define STEELSERIES_BUTTON_CONSUMER 0x61
static const enum ratbag_button_type button_types[6] =
{
RATBAG_BUTTON_TYPE_LEFT,
RATBAG_BUTTON_TYPE_RIGHT,
RATBAG_BUTTON_TYPE_MIDDLE,
RATBAG_BUTTON_TYPE_THUMB,
RATBAG_BUTTON_TYPE_THUMB2,
RATBAG_BUTTON_TYPE_RESOLUTION_CYCLE_UP,
};
static const struct ratbag_button_action button_actions[6] =
{
BUTTON_ACTION_BUTTON(1),
BUTTON_ACTION_BUTTON(2),
BUTTON_ACTION_BUTTON(3),
BUTTON_ACTION_BUTTON(4),
BUTTON_ACTION_BUTTON(5),
BUTTON_ACTION_SPECIAL(RATBAG_BUTTON_ACTION_SPECIAL_RESOLUTION_CYCLE_UP),
};
static int
steelseries_test_hidraw(struct ratbag_device *device)
{
@@ -94,6 +76,50 @@ steelseries_test_hidraw(struct ratbag_device *device)
return true;
}
static void
button_defaults_for_layout(struct ratbag_button *button, int button_count)
{
/* The default button mapping vary depending on the number of buttons
* on the device. */
enum ratbag_button_type button_types[8] = {RATBAG_BUTTON_TYPE_UNKNOWN};
struct ratbag_button_action button_actions[8] = {
BUTTON_ACTION_BUTTON(1),
BUTTON_ACTION_BUTTON(2),
BUTTON_ACTION_BUTTON(3),
BUTTON_ACTION_BUTTON(4),
BUTTON_ACTION_BUTTON(5),
BUTTON_ACTION_BUTTON(6),
BUTTON_ACTION_BUTTON(7),
BUTTON_ACTION_BUTTON(8),
};
if (button_count <= 6) {
button_actions[5].type = RATBAG_BUTTON_ACTION_TYPE_SPECIAL;
button_actions[5].action.special = RATBAG_BUTTON_ACTION_SPECIAL_RESOLUTION_CYCLE_UP;
button_actions[6].type = RATBAG_BUTTON_ACTION_TYPE_NONE;
button_actions[7].type = RATBAG_BUTTON_ACTION_TYPE_NONE;
} else {
button_actions[7].type = RATBAG_BUTTON_ACTION_TYPE_SPECIAL;
button_actions[7].action.special = RATBAG_BUTTON_ACTION_SPECIAL_RESOLUTION_CYCLE_UP;
}
button_types[0] = RATBAG_BUTTON_TYPE_LEFT;
button_types[1] = RATBAG_BUTTON_TYPE_RIGHT;
button_types[2] = RATBAG_BUTTON_TYPE_MIDDLE;
button_types[3] = RATBAG_BUTTON_TYPE_THUMB;
button_types[4] = RATBAG_BUTTON_TYPE_THUMB2;
if (button_count <= 6) {
button_types[5] = RATBAG_BUTTON_TYPE_RESOLUTION_CYCLE_UP;
} else {
button_types[5] = RATBAG_BUTTON_TYPE_PINKIE;
button_types[6] = RATBAG_BUTTON_TYPE_PINKIE2;
button_types[7] = RATBAG_BUTTON_TYPE_RESOLUTION_CYCLE_UP;
}
button->type = button_types[button->index];
ratbag_button_set_action(button, &button_actions[button->index]);
}
static int
steelseries_probe(struct ratbag_device *device)
{
@@ -124,10 +150,11 @@ steelseries_probe(struct ratbag_device *device)
led_count);
/* only later models allow setting buttons on the device */
if (device_version > 1) {
if (ratbag_device_data_steelseries_get_macro_length(device->data) > 0) {
/* set these caps manually as they are not assumed with only 1 profile */
ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON);
ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON_KEY);
ratbag_device_set_capability(device, RATBAG_DEVICE_CAP_BUTTON_MACROS);
}
ratbag_device_unset_capability(device, RATBAG_DEVICE_CAP_QUERY_CONFIGURATION);
@@ -152,8 +179,10 @@ steelseries_probe(struct ratbag_device *device)
(unsigned int *)dpilist->entries,
dpilist->nentries);
resolution->dpi_x = resolution->dpis[resolution->index];
resolution->dpi_y = resolution->dpis[resolution->index];
/* 800 and 1600 seem as reasonable defaults supported
* by all known devices. */
resolution->dpi_x = 800 * (resolution->index + 1);
resolution->dpi_y = 800 * (resolution->index + 1);
ratbag_resolution_set_report_rate_list(resolution, report_rates,
ARRAY_LENGTH(report_rates));
@@ -164,9 +193,9 @@ steelseries_probe(struct ratbag_device *device)
ratbag_button_enable_action_type(button, RATBAG_BUTTON_ACTION_TYPE_BUTTON);
ratbag_button_enable_action_type(button, RATBAG_BUTTON_ACTION_TYPE_SPECIAL);
ratbag_button_enable_action_type(button, RATBAG_BUTTON_ACTION_TYPE_KEY);
ratbag_button_enable_action_type(button, RATBAG_BUTTON_ACTION_TYPE_MACRO);
button->type = button_types[button->index];
ratbag_button_set_action(button, &button_actions[button->index]);
button_defaults_for_layout(button, button_count);
}
ratbag_profile_for_each_led(profile, led) {
@@ -176,6 +205,11 @@ steelseries_probe(struct ratbag_device *device)
led->color.red = 0;
led->color.green = 0;
led->color.blue = 255;
ratbag_led_set_mode_capability(led, RATBAG_LED_OFF);
ratbag_led_set_mode_capability(led, RATBAG_LED_ON);
ratbag_led_set_mode_capability(led, RATBAG_LED_BREATHING);
if (device_version >= 2)
ratbag_led_set_mode_capability(led, RATBAG_LED_CYCLE);
}
}
@@ -222,8 +256,9 @@ steelseries_write_dpi(struct ratbag_resolution *resolution)
buf[6] = 0x42; /* not sure if needed */
}
msleep(10);
ret = ratbag_hidraw_output_report(device, buf, buf_len);
if ((size_t)ret != buf_len)
if (ret < 0)
return ret;
return 0;
@@ -248,8 +283,9 @@ steelseries_write_report_rate(struct ratbag_resolution *resolution)
buf[2] = 1000 / resolution->hz;
}
msleep(10);
ret = ratbag_hidraw_output_report(device, buf, buf_len);
if ((size_t)ret != buf_len)
if (ret < 0)
return ret;
return 0;
@@ -259,12 +295,11 @@ static int
steelseries_write_buttons(struct ratbag_profile *profile)
{
struct ratbag_device *device = profile->device;
int device_version = ratbag_device_data_steelseries_get_device_version(device->data);
uint8_t buf[STEELSERIES_REPORT_LONG_SIZE] = {0};
struct ratbag_button *button;
int ret;
if (device_version < 2)
if (ratbag_device_data_steelseries_get_macro_length(device->data) == 0)
return 0;
buf[0] = STEELSERIES_ID_BUTTONS;
@@ -272,6 +307,7 @@ steelseries_write_buttons(struct ratbag_profile *profile)
ratbag_profile_for_each_button(profile, button) {
struct ratbag_button_action *action = &button->action;
uint16_t code;
unsigned int key, modifiers;
int idx;
/* Each button takes up 5 bytes starting from index 2 */
@@ -282,11 +318,39 @@ steelseries_write_buttons(struct ratbag_profile *profile)
buf[idx] = action->action.button;
break;
case RATBAG_BUTTON_ACTION_TYPE_KEY:
case RATBAG_BUTTON_ACTION_TYPE_MACRO:
ratbag_action_keycode_from_macro(action, &key, &modifiers);
/* There is only space for 3 modifiers */
if (__builtin_popcount(modifiers > 3)) {
log_debug(device->ratbag,
"Too many modifiers in macro for button %d\n",
button->index);
break;
}
code = ratbag_hidraw_get_keyboard_usage_from_keycode(
device, action->action.key.key);
device, key);
if (code) {
buf[idx] = STEELSERIES_BUTTON_KBD;
if (modifiers & MODIFIER_LEFTCTRL)
buf[++idx] = 0xE0;
if (modifiers & MODIFIER_LEFTSHIFT)
buf[++idx] = 0xE1;
if (modifiers & MODIFIER_LEFTALT)
buf[++idx] = 0xE2;
if (modifiers & MODIFIER_LEFTMETA)
buf[++idx] = 0xE3;
if (modifiers & MODIFIER_RIGHTCTRL)
buf[++idx] = 0xE4;
if (modifiers & MODIFIER_RIGHTSHIFT)
buf[++idx] = 0xE5;
if (modifiers & MODIFIER_RIGHTALT)
buf[++idx] = 0xE6;
if (modifiers & MODIFIER_RIGHTMETA)
buf[++idx] = 0xE7;
buf[idx + 1] = code;
} else {
code = ratbag_hidraw_get_consumer_usage_from_keycode(
@@ -312,6 +376,7 @@ steelseries_write_buttons(struct ratbag_profile *profile)
}
break;
case RATBAG_BUTTON_ACTION_TYPE_KEY:
case RATBAG_BUTTON_ACTION_TYPE_NONE:
default:
buf[idx] = STEELSERIES_BUTTON_OFF;
@@ -319,15 +384,59 @@ steelseries_write_buttons(struct ratbag_profile *profile)
}
}
msleep(10);
ret = ratbag_hidraw_output_report(device, buf, sizeof(buf));
if (ret != sizeof(buf))
if (ret < 0)
return ret;
return 0;
}
static int
steelseries_write_led(struct ratbag_led *led)
steelseries_write_led_v1(struct ratbag_led *led)
{
struct ratbag_device *device = led->profile->device;
uint8_t buf[STEELSERIES_REPORT_SIZE_SHORT] = {0};
int ret;
buf[0] = STEELSERIES_ID_LED_EFFECT_SHORT;
buf[1] = led->index + 1;
switch(led->mode) {
case RATBAG_LED_OFF:
case RATBAG_LED_ON:
buf[2] = 0x01;
break;
case RATBAG_LED_BREATHING:
buf[2] = 0x03; /* 0x02: slow, 0x03: medium, 0x04: fast */
break;
case RATBAG_LED_CYCLE:
/* Cycle mode is not supported on this version */
default:
return -EINVAL;
}
msleep(10);
ret = ratbag_hidraw_output_report(device, buf, sizeof(buf));
if (ret < 0)
return ret;
buf[0] = STEELSERIES_ID_LED_COLOR_SHORT;
buf[1] = led->index + 1;
buf[2] = led->color.red;
buf[3] = led->color.green;
buf[4] = led->color.blue;
msleep(10);
ret = ratbag_hidraw_output_report(device, buf, sizeof(buf));
if (ret < 0)
return ret;
return 0;
}
static int
steelseries_write_led_v2(struct ratbag_led *led)
{
struct ratbag_device *device = led->profile->device;
uint8_t buf[STEELSERIES_REPORT_SIZE] = {0};
@@ -424,13 +533,28 @@ steelseries_write_led(struct ratbag_led *led)
hidpp_set_unaligned_le_u16(&buf[3], duration);
msleep(10);
ret = ratbag_hidraw_output_report(device, buf, sizeof(buf));
if (ret != sizeof(buf))
if (ret < 0)
return ret;
return 0;
}
static int
steelseries_write_led(struct ratbag_led *led)
{
struct ratbag_device *device = led->profile->device;
int device_version = ratbag_device_data_steelseries_get_device_version(device->data);
if (device_version == 1)
return steelseries_write_led_v1(led);
else if (device_version == 2)
return steelseries_write_led_v2(led);
return -ENOTSUP;
}
static int
steelseries_write_save(struct ratbag_device *device)
{
@@ -447,8 +571,9 @@ steelseries_write_save(struct ratbag_device *device)
buf[0] = STEELSERIES_ID_SAVE;
}
msleep(20);
ret = ratbag_hidraw_output_report(device, buf, buf_len);
if ((size_t)ret != buf_len)
if (ret < 0)
return ret;
return 0;
@@ -458,10 +583,15 @@ static int
steelseries_write_profile(struct ratbag_profile *profile)
{
struct ratbag_resolution *resolution;
struct ratbag_button *button;
struct ratbag_led *led;
int rc;
bool buttons_dirty = false;
ratbag_profile_for_each_resolution(profile, resolution) {
if (!resolution->dirty)
continue;
rc = steelseries_write_dpi(resolution);
if (rc != 0)
return rc;
@@ -475,9 +605,16 @@ steelseries_write_profile(struct ratbag_profile *profile)
return rc;
}
rc = steelseries_write_buttons(profile);
if (rc != 0)
return rc;
ratbag_profile_for_each_button(profile, button) {
if (button->dirty)
buttons_dirty = true;
}
if (buttons_dirty) {
rc = steelseries_write_buttons(profile);
if (rc != 0)
return rc;
}
ratbag_profile_for_each_led(profile, led) {
if (!led->dirty)

View File

@@ -643,7 +643,7 @@ hidpp10_get_dpi_mapping(struct hidpp10_device *dev, unsigned int value)
min_delta = INT_MAX;
for (i = 0; i < dev->dpi_count; i++) {
delta = abs(value - m[i].dpi);
delta = abs((int)value - (int)m[i].dpi);
if (delta < min_delta) {
result = m[i].raw_value;
min_delta = delta;

View File

@@ -70,6 +70,7 @@ struct data_steelseries {
int led_count;
struct dpi_list *dpi_list;
struct dpi_range *dpi_range;
int macro_length;
};
struct ratbag_device_data {
@@ -202,6 +203,13 @@ init_data_steelseries(struct ratbag *ratbag,
if (str)
data->steelseries.dpi_list = dpi_list_from_string(str);
}
error = NULL;
num = g_key_file_get_integer(keyfile, group, "MacroLength", &error);
if (num > 0 || !error)
data->steelseries.macro_length = num;
if (error)
g_error_free(error);
}
static const struct driver_map {
@@ -584,3 +592,10 @@ ratbag_device_data_steelseries_get_dpi_range(const struct ratbag_device_data *da
return data->steelseries.dpi_range;
}
int
ratbag_device_data_steelseries_get_macro_length(const struct ratbag_device_data *data)
{
assert(data->drivertype == STEELSERIES);
return data->steelseries.macro_length;
}

View File

@@ -108,3 +108,5 @@ ratbag_device_data_steelseries_get_dpi_list(const struct ratbag_device_data *dat
struct dpi_range *
ratbag_device_data_steelseries_get_dpi_range(const struct ratbag_device_data *data);
int
ratbag_device_data_steelseries_get_macro_length(const struct ratbag_device_data *data);

View File

@@ -267,6 +267,7 @@ struct ratbag_resolution {
bool is_active;
bool is_default;
bool dirty;
uint32_t capabilities;
};
@@ -355,6 +356,15 @@ struct ratbag_button_macro {
struct ratbag_macro macro;
};
#define MODIFIER_LEFTCTRL (1 << 0)
#define MODIFIER_LEFTSHIFT (1 << 1)
#define MODIFIER_LEFTALT (1 << 2)
#define MODIFIER_LEFTMETA (1 << 3)
#define MODIFIER_RIGHTCTRL (1 << 4)
#define MODIFIER_RIGHTSHIFT (1 << 5)
#define MODIFIER_RIGHTALT (1 << 6)
#define MODIFIER_RIGHTMETA (1 << 7)
struct ratbag_button_action {
enum ratbag_button_action_type type;
union ratbag_btn_action {
@@ -478,6 +488,19 @@ ratbag_button_action_match(const struct ratbag_button_action *action,
return 0;
}
int
ratbag_action_macro_num_keys(struct ratbag_button_action *action);
int
ratbag_button_macro_new_from_keycode(struct ratbag_button *button,
unsigned int key,
unsigned int modifiers);
int
ratbag_action_keycode_from_macro(struct ratbag_button_action *action,
unsigned int *key_out,
unsigned int *modifiers_out);
static inline void
ratbag_resolution_set_resolution(struct ratbag_resolution *res,
int dpi_x, int dpi_y, int hz)

View File

@@ -57,6 +57,15 @@ list_insert(struct list *list, struct list *elm)
elm->next->prev = elm;
}
void
list_append(struct list *list, struct list *elm)
{
elm->next = list;
elm->prev = list->prev;
list->prev = elm;
elm->prev->next = elm;
}
void
list_remove(struct list *elm)
{

View File

@@ -45,6 +45,7 @@ struct list {
void list_init(struct list *list);
void list_insert(struct list *list, struct list *elm);
void list_append(struct list *list, struct list *elm);
void list_remove(struct list *elm);
int list_empty(const struct list *list);

View File

@@ -976,6 +976,8 @@ ratbag_device_commit(struct ratbag_device *device)
{
struct ratbag_profile *profile;
struct ratbag_button *button;
struct ratbag_led *led;
struct ratbag_resolution *resolution;
int rc;
if (!device->driver->commit) {
@@ -993,6 +995,13 @@ ratbag_device_commit(struct ratbag_device *device)
list_for_each(button, &profile->buttons, link)
button->dirty = false;
list_for_each(led, &profile->leds, link)
led->dirty = false;
list_for_each(resolution, &profile->resolutions, link)
resolution->dirty = false;
}
return RATBAG_SUCCESS;
@@ -1098,6 +1107,7 @@ ratbag_resolution_set_dpi(struct ratbag_resolution *resolution,
if (resolution->dpi_x != dpi || resolution->dpi_y != dpi) {
resolution->dpi_x = dpi;
resolution->dpi_y = dpi;
resolution->dirty = true;
profile->dirty = true;
}
@@ -1120,6 +1130,7 @@ ratbag_resolution_set_dpi_xy(struct ratbag_resolution *resolution,
if (resolution->dpi_x != x || resolution->dpi_y != y) {
resolution->dpi_x = x;
resolution->dpi_y = y;
resolution->dirty = true;
profile->dirty = true;
}
@@ -1134,6 +1145,7 @@ ratbag_resolution_set_report_rate(struct ratbag_resolution *resolution,
RATBAG_RESOLUTION_CAP_INDIVIDUAL_REPORT_RATE)) {
if (resolution->hz != hz) {
resolution->hz = hz;
resolution->dirty = true;
resolution->profile->dirty = true;
}
} else {
@@ -1145,6 +1157,7 @@ ratbag_resolution_set_report_rate(struct ratbag_resolution *resolution,
ratbag_profile_for_each_resolution(profile, res) {
if (res->hz != hz) {
res->hz = hz;
res->dirty = true;
profile->dirty = true;
}
}
@@ -1229,6 +1242,7 @@ ratbag_resolution_set_active(struct ratbag_resolution *resolution)
res->is_active = false;
resolution->is_active = true;
resolution->dirty = true;
profile->dirty = true;
return RATBAG_SUCCESS;
}
@@ -1252,11 +1266,13 @@ ratbag_resolution_set_default(struct ratbag_resolution *resolution)
continue;
other->is_default = false;
resolution->dirty = true;
profile->dirty = true;
}
if (!resolution->is_default) {
resolution->is_default = true;
resolution->dirty = true;
profile->dirty = true;
}
@@ -1905,3 +1921,167 @@ ratbag_button_macro_new(const char *name)
return macro;
}
struct ratbag_modifier_mapping {
unsigned int modifier_mask;
unsigned int key;
};
struct ratbag_modifier_mapping ratbag_modifier_mapping[] = {
{ MODIFIER_LEFTCTRL, KEY_LEFTCTRL },
{ MODIFIER_LEFTSHIFT, KEY_LEFTSHIFT },
{ MODIFIER_LEFTALT, KEY_LEFTALT },
{ MODIFIER_LEFTMETA, KEY_LEFTMETA },
{ MODIFIER_RIGHTCTRL, KEY_RIGHTCTRL },
{ MODIFIER_RIGHTSHIFT, KEY_RIGHTSHIFT },
{ MODIFIER_RIGHTALT, KEY_RIGHTALT },
{ MODIFIER_RIGHTMETA, KEY_RIGHTMETA },
};
int
ratbag_button_macro_new_from_keycode(struct ratbag_button *button,
unsigned int key,
unsigned int modifiers)
{
struct ratbag_button_macro *macro;
struct ratbag_modifier_mapping *mapping;
int i;
macro = ratbag_button_macro_new("key");
i = 0;
ARRAY_FOR_EACH(ratbag_modifier_mapping, mapping) {
if (modifiers & mapping->modifier_mask)
ratbag_button_macro_set_event(macro,
i++,
RATBAG_MACRO_EVENT_KEY_PRESSED,
mapping->key);
}
ratbag_button_macro_set_event(macro,
i++,
RATBAG_MACRO_EVENT_KEY_PRESSED,
key);
ratbag_button_macro_set_event(macro,
i++,
RATBAG_MACRO_EVENT_KEY_RELEASED,
key);
ARRAY_FOR_EACH(ratbag_modifier_mapping, mapping) {
if (modifiers & mapping->modifier_mask)
ratbag_button_macro_set_event(macro,
i++,
RATBAG_MACRO_EVENT_KEY_RELEASED,
mapping->key);
}
ratbag_button_copy_macro(button, macro);
ratbag_button_macro_unref(macro);
return 0;
}
int
ratbag_action_macro_num_keys(struct ratbag_button_action *action)
{
struct ratbag_macro *macro = action->macro;
int i, count;
count = 0;
for (i = 0; i < MAX_MACRO_EVENTS; i++) {
struct ratbag_macro_event event;
event = macro->events[i];
if (event.type == RATBAG_MACRO_EVENT_KEY_PRESSED)
{
switch(event.event.key) {
case KEY_LEFTCTRL:
case KEY_LEFTSHIFT:
case KEY_LEFTALT:
case KEY_LEFTMETA:
case KEY_RIGHTCTRL:
case KEY_RIGHTSHIFT:
case KEY_RIGHTALT:
case KEY_RIGHTMETA:
break;
default:
count++;
}
}
}
return count;
}
int
ratbag_action_keycode_from_macro(struct ratbag_button_action *action,
unsigned int *key_out,
unsigned int *modifiers_out)
{
struct ratbag_macro *macro = action->macro;
unsigned int key = KEY_RESERVED;
unsigned int modifiers = 0;
unsigned int i;
if (!macro || action->type != RATBAG_BUTTON_ACTION_TYPE_MACRO)
return -EINVAL;
if (macro->events[0].type == RATBAG_MACRO_EVENT_NONE)
return -EINVAL;
if (ratbag_action_macro_num_keys(action) != 1)
return -EINVAL;
for (i = 0; i < MAX_MACRO_EVENTS; i++) {
struct ratbag_macro_event event;
event = macro->events[i];
switch (event.type) {
case RATBAG_MACRO_EVENT_INVALID:
return -EINVAL;
case RATBAG_MACRO_EVENT_NONE:
return 0;
case RATBAG_MACRO_EVENT_KEY_PRESSED:
switch(event.event.key) {
case KEY_LEFTCTRL: modifiers |= MODIFIER_LEFTCTRL; break;
case KEY_LEFTSHIFT: modifiers |= MODIFIER_LEFTSHIFT; break;
case KEY_LEFTALT: modifiers |= MODIFIER_LEFTALT; break;
case KEY_LEFTMETA: modifiers |= MODIFIER_LEFTMETA; break;
case KEY_RIGHTCTRL: modifiers |= MODIFIER_RIGHTCTRL; break;
case KEY_RIGHTSHIFT: modifiers |= MODIFIER_RIGHTSHIFT; break;
case KEY_RIGHTALT: modifiers |= MODIFIER_RIGHTALT; break;
case KEY_RIGHTMETA: modifiers |= MODIFIER_RIGHTMETA; break;
default:
if (key != KEY_RESERVED)
return -EINVAL;
key = event.event.key;
}
break;
case RATBAG_MACRO_EVENT_KEY_RELEASED:
switch(event.event.key) {
case KEY_LEFTCTRL: modifiers &= ~MODIFIER_LEFTCTRL; break;
case KEY_LEFTSHIFT: modifiers &= ~MODIFIER_LEFTSHIFT; break;
case KEY_LEFTALT: modifiers &= ~MODIFIER_LEFTALT; break;
case KEY_LEFTMETA: modifiers &= ~MODIFIER_LEFTMETA; break;
case KEY_RIGHTCTRL: modifiers &= ~MODIFIER_RIGHTCTRL; break;
case KEY_RIGHTSHIFT: modifiers &= ~MODIFIER_RIGHTSHIFT; break;
case KEY_RIGHTALT: modifiers &= ~MODIFIER_RIGHTALT; break;
case KEY_RIGHTMETA: modifiers &= ~MODIFIER_RIGHTMETA; break;
default:
if (event.event.key != key)
return -EINVAL;
*key_out = key;
*modifiers_out = modifiers;
return 1;
}
case RATBAG_MACRO_EVENT_WAIT:
break;
default:
return -EINVAL;
}
}
return -EINVAL;
}

View File

@@ -246,9 +246,9 @@ class Ratbagd(_RatbagdDBus):
__gsignals__ = {
"device-added":
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
"device-removed":
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
}
def __init__(self):
@@ -313,7 +313,7 @@ class RatbagdDevice(_RatbagdDBus):
__gsignals__ = {
"active-profile-changed":
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
}
def __init__(self, object_path):
@@ -450,7 +450,7 @@ class RatbagdProfile(_RatbagdDBus):
"""
return self._get_dbus_property("Capabilities")
@GObject.property
@GObject.Property
def name(self):
"""The name of the profile"""
return self._get_dbus_property("Name")
@@ -820,7 +820,7 @@ class RatbagdMacro(GObject.Object):
}
__gsignals__ = {
'macro-set': (GObject.SIGNAL_RUN_FIRST, None, ()),
'macro-set': (GObject.SignalFlags.RUN_FIRST, None, ()),
}
def __init__(self, **kwargs):