├── .github
└── workflows
│ ├── release.yaml
│ └── test.yaml
├── .gitignore
├── .releaserc.yaml
├── CONTRIBUTING.md
├── Cargo.lock
├── Cargo.toml
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── bindings
└── dbus-xml
│ ├── org.shadowblip.Input.CompositeDevice.xml
│ ├── org.shadowblip.Input.DBusDevice.xml
│ ├── org.shadowblip.Input.Gamepad.xml
│ ├── org.shadowblip.Input.Keyboard.xml
│ ├── org.shadowblip.Input.Manager.xml
│ ├── org.shadowblip.Input.Mouse.xml
│ ├── org.shadowblip.Input.Source.EventDevice.xml
│ └── org.shadowblip.Input.Source.HIDRawDevice.xml
├── docs
├── composite_device.md
├── dbus2markdown.xsl
├── manager.md
├── source_event_device.md
├── source_hidraw_device.md
├── target_dbus.md
├── target_gamepad.md
├── target_keyboard.md
└── target_mouse.md
├── examples
└── unified_gamepad
│ └── main.rs
├── icon.svg
├── pkg
├── archlinux
│ └── PKGBUILD
└── rpm
│ └── inputplumber.spec
├── rootfs
└── usr
│ ├── lib
│ ├── systemd
│ │ └── system
│ │ │ ├── inputplumber-suspend.service
│ │ │ └── inputplumber.service
│ └── udev
│ │ ├── hwdb.d
│ │ ├── 59-inputplumber.hwdb
│ │ └── 60-inputplumber-autostart.hwdb
│ │ └── rules.d
│ │ └── 90-inputplumber-autostart.rules
│ └── share
│ ├── dbus-1
│ ├── system-services
│ │ └── org.shadowblip.InputPlumber.service
│ └── system.d
│ │ └── org.shadowblip.InputPlumber.conf
│ └── inputplumber
│ ├── capability_maps
│ ├── ally_type1.yaml
│ ├── anbernic_type1.yaml
│ ├── ayaneo_type1.yaml
│ ├── ayaneo_type2.yaml
│ ├── ayaneo_type3.yaml
│ ├── ayaneo_type4.yaml
│ ├── ayaneo_type5.yaml
│ ├── ayaneo_type6.yaml
│ ├── ayn_type1.yaml
│ ├── dinput_generic.yaml
│ ├── flydigi_vader_4_pro.yaml
│ ├── gpd_type1.yaml
│ ├── gpd_type2.yaml
│ ├── gpd_type3.yaml
│ ├── imu_generic.yaml
│ ├── logitech_dualaction.yaml
│ ├── msiclaw_type1.yaml
│ ├── onexplayer_type1.yaml
│ ├── onexplayer_type2.yaml
│ ├── onexplayer_type3.yaml
│ ├── onexplayer_type4.yaml
│ ├── orangepi_type1.yaml
│ ├── swap_west_north.yaml
│ └── zone_type1.yaml
│ ├── devices
│ ├── 10-ignore_unsupported.yaml
│ ├── 50-anbernic_win600.yaml
│ ├── 50-aokzoe_a1.yaml
│ ├── 50-ayaneo_2.yaml
│ ├── 50-ayaneo_2021.yaml
│ ├── 50-ayaneo_2s.yaml
│ ├── 50-ayaneo_air.yaml
│ ├── 50-ayaneo_air_1s.yaml
│ ├── 50-ayaneo_air_plus.yaml
│ ├── 50-ayaneo_air_plus_mendo.yaml
│ ├── 50-ayaneo_flip.yaml
│ ├── 50-ayaneo_kun.yaml
│ ├── 50-ayaneo_next.yaml
│ ├── 50-ayaneo_slide.yaml
│ ├── 50-ayn_loki_max.yaml
│ ├── 50-ayn_loki_mini_pro.yaml
│ ├── 50-ayn_loki_zero.yaml
│ ├── 50-gpd_win3.yaml
│ ├── 50-gpd_win4.yaml
│ ├── 50-gpd_winmax2.yaml
│ ├── 50-gpd_winmini.yaml
│ ├── 50-legion_go.yaml
│ ├── 50-legion_go_2.yaml
│ ├── 50-legion_go_s.yaml
│ ├── 50-msi_claw7_a2vm.yaml
│ ├── 50-msi_claw8_a2vm.yaml
│ ├── 50-msi_claw_a1m.yaml
│ ├── 50-onexplayer_2.yaml
│ ├── 50-onexplayer_amd.yaml
│ ├── 50-onexplayer_intel.yaml
│ ├── 50-onexplayer_mini_a07.yaml
│ ├── 50-onexplayer_mini_pro.yaml
│ ├── 50-onexplayer_onexfly.yaml
│ ├── 50-onexplayer_onexfly_pro.yaml
│ ├── 50-orangepi_neo.yaml
│ ├── 50-rog_ally.yaml
│ ├── 50-rog_ally_x.yaml
│ ├── 50-steam_deck.yaml
│ ├── 50-zotac-zone.yaml
│ ├── 60-8bit_do_pro_2.yaml
│ ├── 60-LogitechDualAction.yaml
│ ├── 60-flydigi_vader_4_pro.yaml
│ ├── 60-horipad_steam.yaml
│ ├── 60-ps4_gamepad.yaml
│ ├── 60-ps5_ds-edge_gamepad.yaml
│ ├── 60-ps5_ds_gamepad.yaml
│ ├── 60-switch_pro.yaml
│ ├── 60-xbox_360_gamepad.yaml
│ ├── 60-xbox_gamepad.yaml
│ ├── 60-xbox_one_bt_gamepad.yaml
│ ├── 60-xbox_one_elite_gamepad.yaml
│ ├── 60-xbox_one_gamepad.yaml
│ ├── 65-generic_gamepad.yaml
│ └── 69-ignore_generic.yaml
│ ├── profiles
│ ├── debug.yaml
│ ├── default.yaml
│ ├── mouse_keyboard_wasd.yaml
│ └── test.yaml
│ └── schema
│ ├── capability_map_v1.json
│ ├── capability_map_v2.json
│ ├── composite_device_v1.json
│ └── device_profile_v1.json
└── src
├── bluetooth
├── device1.rs
└── mod.rs
├── cli
├── device.rs
├── mod.rs
├── source.rs
├── target.rs
├── ui.rs
└── ui
│ ├── menu.rs
│ ├── menu
│ └── device_test_menu.rs
│ ├── widgets.rs
│ └── widgets
│ ├── axis_gauge.rs
│ ├── button_gauge.rs
│ ├── gyro_gauge.rs
│ ├── touch_gauge.rs
│ └── trigger_gauge.rs
├── config
├── capability_map.rs
├── capability_map
│ ├── evdev.rs
│ └── hidraw.rs
├── mod.rs
└── path.rs
├── constants.rs
├── dbus
├── interface
│ ├── composite_device.rs
│ ├── manager.rs
│ ├── mod.rs
│ ├── source
│ │ ├── evdev.rs
│ │ ├── hidraw.rs
│ │ ├── iio_imu.rs
│ │ ├── led.rs
│ │ ├── mod.rs
│ │ └── udev.rs
│ └── target
│ │ ├── dbus.rs
│ │ ├── debug.rs
│ │ ├── gamepad.rs
│ │ ├── keyboard.rs
│ │ ├── mod.rs
│ │ ├── mouse.rs
│ │ └── touchscreen.rs
└── mod.rs
├── dmi
├── data.rs
└── mod.rs
├── drivers
├── dualsense
│ ├── driver.rs
│ ├── event.rs
│ ├── hid_report.rs
│ ├── hid_report_test.rs
│ ├── mod.rs
│ └── report_descriptor.rs
├── dualshock4
│ └── report_descriptors.rs
├── flydigi_vader_4_pro
│ ├── driver.rs
│ ├── event.rs
│ ├── hid_report.rs
│ ├── mod.rs
│ └── report_descriptor.rs
├── fts3528
│ ├── driver.rs
│ ├── event.rs
│ ├── hid_report.rs
│ ├── hid_report_test.rs
│ ├── mod.rs
│ └── report_descriptor.rs
├── horipad_steam
│ ├── driver.rs
│ ├── event.rs
│ ├── hid_report.rs
│ ├── hid_report_test.rs
│ ├── mod.rs
│ └── report_descriptor.rs
├── iio_imu
│ ├── driver.rs
│ ├── event.rs
│ ├── info.rs
│ └── mod.rs
├── lego
│ ├── driver_dinput_combined.rs
│ ├── driver_dinput_split.rs
│ ├── driver_fps_mode.rs
│ ├── driver_xinput.rs
│ ├── event.rs
│ ├── hid_report.rs
│ └── mod.rs
├── legos
│ ├── config_driver.rs
│ ├── event.rs
│ ├── hid_report.rs
│ ├── imu_driver.rs
│ ├── mod.rs
│ ├── touchpad_driver.rs
│ └── xinput_driver.rs
├── mod.rs
├── msi_claw
│ ├── driver.rs
│ ├── hid_report.rs
│ └── mod.rs
├── opineo
│ ├── driver.rs
│ ├── event.rs
│ ├── hid_report.rs
│ ├── hid_report_test.rs
│ └── mod.rs
├── rog_ally
│ ├── driver.rs
│ └── mod.rs
├── steam_deck
│ ├── driver.rs
│ ├── event.rs
│ ├── hid_report.rs
│ ├── mod.rs
│ └── report_descriptor.rs
├── unified_gamepad
│ ├── capability.rs
│ ├── driver.rs
│ ├── event.rs
│ ├── mod.rs
│ ├── reports.rs
│ ├── reports
│ │ ├── input_capability_report.rs
│ │ ├── input_capability_report_test.rs
│ │ ├── input_data_report.rs
│ │ └── input_data_report_test.rs
│ └── value.rs
├── xpad_uhid
│ ├── driver.rs
│ ├── event.rs
│ ├── hid_report.rs
│ ├── hid_report_test.rs
│ └── mod.rs
└── zotac_zone
│ ├── driver.rs
│ └── mod.rs
├── generate.rs
├── iio
├── device.rs
└── mod.rs
├── input
├── capability.rs
├── composite_device
│ ├── client.rs
│ ├── command.rs
│ ├── mod.rs
│ └── targets.rs
├── event
│ ├── dbus.rs
│ ├── evdev.rs
│ ├── evdev
│ │ └── translator.rs
│ ├── mod.rs
│ ├── native.rs
│ └── value.rs
├── manager.rs
├── mod.rs
├── output_capability.rs
├── output_event
│ └── mod.rs
├── source
│ ├── client.rs
│ ├── command.rs
│ ├── evdev.rs
│ ├── evdev
│ │ ├── blocked.rs
│ │ ├── gamepad.rs
│ │ ├── keyboard.rs
│ │ └── touchscreen.rs
│ ├── hidraw.rs
│ ├── hidraw
│ │ ├── blocked.rs
│ │ ├── dualsense.rs
│ │ ├── dualshock4.rs
│ │ ├── flydigi_vader_4_pro.rs
│ │ ├── fts3528.rs
│ │ ├── horipad_steam.rs
│ │ ├── lego_dinput_combined.rs
│ │ ├── lego_dinput_split.rs
│ │ ├── lego_fps_mode.rs
│ │ ├── lego_xinput.rs
│ │ ├── legos_config.rs
│ │ ├── legos_imu.rs
│ │ ├── legos_touchpad.rs
│ │ ├── legos_xinput.rs
│ │ ├── msi_claw.rs
│ │ ├── opineo.rs
│ │ ├── rog_ally.rs
│ │ ├── steam_deck.rs
│ │ ├── xpad_uhid.rs
│ │ └── zotac_zone.rs
│ ├── iio.rs
│ ├── iio
│ │ ├── accel_gyro_3d.rs
│ │ └── bmi_imu.rs
│ ├── led.rs
│ ├── led
│ │ └── multicolor.rs
│ ├── mod.rs
│ ├── mod_test.rs
│ └── network.rs
└── target
│ ├── client.rs
│ ├── command.rs
│ ├── dbus.rs
│ ├── debug.rs
│ ├── dualsense.rs
│ ├── horipad_steam.rs
│ ├── keyboard.rs
│ ├── mod.rs
│ ├── mouse.rs
│ ├── steam_deck.rs
│ ├── steam_deck_uhid.rs
│ ├── touchpad.rs
│ ├── touchscreen.rs
│ ├── unified_gamepad.rs
│ ├── xb360.rs
│ ├── xbox_elite.rs
│ └── xbox_series.rs
├── lib.rs
├── main.rs
├── udev
├── device.rs
├── device_test.rs
└── mod.rs
└── watcher
└── mod.rs
/.github/workflows/test.yaml:
--------------------------------------------------------------------------------
1 | name: 🪲 Test
2 |
3 | on: [push]
4 |
5 | jobs:
6 | run-tests:
7 | name: Run tests
8 | runs-on: ubuntu-latest
9 |
10 | steps:
11 | - uses: actions/checkout@v3
12 | - run: |
13 | make in-docker TARGET='test'
14 |
15 | build-x86_64:
16 | name: Run x86_64 build
17 | runs-on: ubuntu-latest
18 |
19 | steps:
20 | - uses: actions/checkout@v3
21 | - run: |
22 | make in-docker TARGET='dist' BUILD_TYPE='debug'
23 |
24 | build-aarch64:
25 | name: Run aarch64 build
26 | runs-on: ubuntu-latest
27 |
28 | steps:
29 | - uses: actions/checkout@v3
30 | - run: |
31 | make in-docker TARGET='dist' BUILD_TYPE='debug' TARGET_ARCH='aarch64-unknown-linux-gnu'
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | /.cache
3 | /dist
4 | /settings.mk
5 | /.vscode
--------------------------------------------------------------------------------
/.releaserc.yaml:
--------------------------------------------------------------------------------
1 | # Semantic Release Configuration
2 | # https://semantic-release.gitbook.io/semantic-release/usage/configuration
3 |
4 | # Any merges into branches that match these patterns will trigger a release.
5 | branches:
6 | - name: main
7 | #- name: 'v+([0-9])?(.{+([0-9]),x}).x'
8 |
9 | # These plugins will run when a release is triggered. They will analyze commit
10 | # messages to determine what kind of release this is and publish a new release.
11 | plugins:
12 | # Analyze commit messages to determine next version
13 | - "@semantic-release/commit-analyzer"
14 |
15 | # Generate release notes
16 | - "@semantic-release/release-notes-generator"
17 |
18 | # Replace version strings in the project. The 'git' plugin is needed to
19 | # commit the version strings to the repository.
20 | - - "@google/semantic-release-replace-plugin"
21 | - replacements:
22 | - files:
23 | - Cargo.toml
24 | from: '^version = .*"$'
25 | to: 'version = "${nextRelease.version}"'
26 | - files:
27 | - pkg/rpm/inputplumber.spec
28 | from: "^Version: .*$"
29 | to: "Version: ${nextRelease.version}"
30 | - files:
31 | - pkg/archlinux/PKGBUILD
32 | from: "^pkgver=v.*$"
33 | to: "pkgver=v${nextRelease.version}"
34 |
35 | # Execute commands to build the project
36 | - - "@semantic-release/exec"
37 | - shell: true
38 | prepareCmd: |
39 | make in-docker TARGET='dist update-pkgbuild-hash'
40 | make in-docker TARGET='dist' TARGET_ARCH="aarch64-unknown-linux-gnu"
41 | publishCmd: "echo '${nextRelease.version}' > .version.txt"
42 |
43 | # Commit the following changes to git after other plugins have run
44 | - - "@semantic-release/git"
45 | - assets:
46 | - Cargo.toml
47 | - Cargo.lock
48 | - pkg/rpm/inputplumber.spec
49 | - pkg/archlinux/PKGBUILD
50 |
51 | # Publish artifacts as a GitHub release
52 | - - "@semantic-release/github"
53 | - assets:
54 | - path: dist/inputplumber-*.rpm
55 | - path: dist/inputplumber-*.rpm.sha256.txt
56 | - path: dist/inputplumber-*.tar.gz
57 | - path: dist/inputplumber-*.tar.gz.sha256.txt
58 | - path: dist/inputplumber-*.raw
59 | - path: dist/inputplumber-*.raw.sha256.txt
60 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rust:1.84
2 |
3 | RUN dpkg --add-architecture arm64
4 | RUN apt-get update && apt-get install -y \
5 | zstd \
6 | libclang-dev \
7 | libudev-dev \
8 | libiio-dev \
9 | squashfs-tools
10 |
11 | RUN apt-get install -y \
12 | g++-aarch64-linux-gnu \
13 | libc6-dev-arm64-cross \
14 | libudev-dev:arm64 \
15 | libiio-dev:arm64
16 |
17 | RUN rustup target add aarch64-unknown-linux-gnu
18 | RUN rustup toolchain install stable-aarch64-unknown-linux-gnu
19 |
20 | ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
21 | ENV CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
22 | ENV CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
23 |
--------------------------------------------------------------------------------
/bindings/dbus-xml/org.shadowblip.Input.DBusDevice.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/bindings/dbus-xml/org.shadowblip.Input.Gamepad.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/bindings/dbus-xml/org.shadowblip.Input.Keyboard.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 |
39 |
40 |
41 |
42 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/bindings/dbus-xml/org.shadowblip.Input.Manager.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/bindings/dbus-xml/org.shadowblip.Input.Mouse.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/bindings/dbus-xml/org.shadowblip.Input.Source.EventDevice.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/bindings/dbus-xml/org.shadowblip.Input.Source.HIDRawDevice.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/docs/manager.md:
--------------------------------------------------------------------------------
1 |
2 | # Manager DBus Interface API
3 |
4 | ## org.shadowblip.InputManager
5 |
6 | ### Properties
7 |
8 |
9 | | Name | Access | Type | Description |
10 | | --- | :---: | :---: | --- |
11 | | **InterceptMode** | *read* | *s* | |
12 |
13 | ### Methods
14 |
15 | #### CreateCompositeDevice
16 |
17 |
18 |
19 | ##### Arguments
20 |
21 | | Name | Direction | Type | Description |
22 | | --- | :---: | :---: | --- |
23 | | **config\_path** | *in* | *s* | |
24 | | **** | *out* | *s* | |
25 |
26 |
27 |
28 | ### Signals
29 |
30 | ## org.freedesktop.DBus.Introspectable
31 |
32 | ### Methods
33 |
34 | #### Introspect
35 |
36 |
37 |
38 | ##### Arguments
39 |
40 | | Name | Direction | Type | Description |
41 | | --- | :---: | :---: | --- |
42 | | **** | *out* | *s* | |
43 |
44 |
45 |
46 | ### Signals
47 |
48 | ## org.freedesktop.DBus.Properties
49 |
50 | ### Methods
51 |
52 | #### Get
53 |
54 |
55 |
56 | ##### Arguments
57 |
58 | | Name | Direction | Type | Description |
59 | | --- | :---: | :---: | --- |
60 | | **interface\_name** | *in* | *s* | |
61 | | **property\_name** | *in* | *s* | |
62 | | **** | *out* | *v* | |
63 |
64 |
65 | #### Set
66 |
67 |
68 |
69 | ##### Arguments
70 |
71 | | Name | Direction | Type | Description |
72 | | --- | :---: | :---: | --- |
73 | | **interface\_name** | *in* | *s* | |
74 | | **property\_name** | *in* | *s* | |
75 | | **value** | *in* | *v* | |
76 |
77 |
78 | #### GetAll
79 |
80 |
81 |
82 | ##### Arguments
83 |
84 | | Name | Direction | Type | Description |
85 | | --- | :---: | :---: | --- |
86 | | **interface\_name** | *in* | *s* | |
87 | | **** | *out* | *a{sv}* | |
88 |
89 |
90 |
91 | ### Signals
92 |
93 | #### PropertiesChanged
94 |
95 |
96 |
97 | ##### Arguments
98 |
99 | | Name | Direction | Type | Description |
100 | | --- | :---: | :---: | --- |
101 | | **interface\_name** | ** | *s* | |
102 | | **changed\_properties** | ** | *a{sv}* | |
103 | | **invalidated\_properties** | ** | *as* | |
104 |
105 |
106 | ## org.freedesktop.DBus.Peer
107 |
108 | ### Methods
109 |
110 | #### Ping
111 |
112 |
113 |
114 |
115 | #### GetMachineId
116 |
117 |
118 |
119 | ##### Arguments
120 |
121 | | Name | Direction | Type | Description |
122 | | --- | :---: | :---: | --- |
123 | | **** | *out* | *s* | |
124 |
125 |
126 |
127 | ### Signals
128 |
--------------------------------------------------------------------------------
/docs/source_event_device.md:
--------------------------------------------------------------------------------
1 |
2 | # Source EventDevice DBus Interface API
3 |
4 | ## org.freedesktop.DBus.Properties
5 |
6 | ### Methods
7 |
8 | #### Get
9 |
10 |
11 |
12 | ##### Arguments
13 |
14 | | Name | Direction | Type | Description |
15 | | --- | :---: | :---: | --- |
16 | | **interface\_name** | *in* | *s* | |
17 | | **property\_name** | *in* | *s* | |
18 | | **** | *out* | *v* | |
19 |
20 |
21 | #### Set
22 |
23 |
24 |
25 | ##### Arguments
26 |
27 | | Name | Direction | Type | Description |
28 | | --- | :---: | :---: | --- |
29 | | **interface\_name** | *in* | *s* | |
30 | | **property\_name** | *in* | *s* | |
31 | | **value** | *in* | *v* | |
32 |
33 |
34 | #### GetAll
35 |
36 |
37 |
38 | ##### Arguments
39 |
40 | | Name | Direction | Type | Description |
41 | | --- | :---: | :---: | --- |
42 | | **interface\_name** | *in* | *s* | |
43 | | **** | *out* | *a{sv}* | |
44 |
45 |
46 |
47 | ### Signals
48 |
49 | #### PropertiesChanged
50 |
51 |
52 |
53 | ##### Arguments
54 |
55 | | Name | Direction | Type | Description |
56 | | --- | :---: | :---: | --- |
57 | | **interface\_name** | ** | *s* | |
58 | | **changed\_properties** | ** | *a{sv}* | |
59 | | **invalidated\_properties** | ** | *as* | |
60 |
61 |
62 | ## org.freedesktop.DBus.Peer
63 |
64 | ### Methods
65 |
66 | #### Ping
67 |
68 |
69 |
70 |
71 | #### GetMachineId
72 |
73 |
74 |
75 | ##### Arguments
76 |
77 | | Name | Direction | Type | Description |
78 | | --- | :---: | :---: | --- |
79 | | **** | *out* | *s* | |
80 |
81 |
82 |
83 | ### Signals
84 |
85 | ## org.freedesktop.DBus.Introspectable
86 |
87 | ### Methods
88 |
89 | #### Introspect
90 |
91 |
92 |
93 | ##### Arguments
94 |
95 | | Name | Direction | Type | Description |
96 | | --- | :---: | :---: | --- |
97 | | **** | *out* | *s* | |
98 |
99 |
100 |
101 | ### Signals
102 |
103 | ## org.shadowblip.Input.Source.EventDevice
104 |
105 | ### Properties
106 |
107 |
108 | | Name | Access | Type | Description |
109 | | --- | :---: | :---: | --- |
110 | | **DevicePath** | *read* | *s* | |
111 | | **Handlers** | *read* | *as* | |
112 | | **Name** | *read* | *s* | |
113 | | **PhysPath** | *read* | *s* | |
114 | | **SysfsPath** | *read* | *s* | |
115 | | **UniqueId** | *read* | *s* | |
116 |
117 | ### Methods
118 |
119 |
120 | ### Signals
121 |
--------------------------------------------------------------------------------
/docs/source_hidraw_device.md:
--------------------------------------------------------------------------------
1 |
2 | # Source HIDRaw DBus Interface API
3 |
4 | ## org.shadowblip.Input.Source.HIDRawDevice
5 |
6 | ### Properties
7 |
8 |
9 | | Name | Access | Type | Description |
10 | | --- | :---: | :---: | --- |
11 | | **InterfaceNumber** | *read* | *i* | |
12 | | **Manufacturer** | *read* | *s* | |
13 | | **Path** | *read* | *s* | |
14 | | **Product** | *read* | *s* | |
15 | | **ProductId** | *read* | *s* | |
16 | | **ReleaseNumber** | *read* | *s* | |
17 | | **SerialNumber** | *read* | *s* | |
18 | | **VendorId** | *read* | *s* | |
19 |
20 | ### Methods
21 |
22 |
23 | ### Signals
24 |
25 | ## org.freedesktop.DBus.Properties
26 |
27 | ### Methods
28 |
29 | #### Get
30 |
31 |
32 |
33 | ##### Arguments
34 |
35 | | Name | Direction | Type | Description |
36 | | --- | :---: | :---: | --- |
37 | | **interface\_name** | *in* | *s* | |
38 | | **property\_name** | *in* | *s* | |
39 | | **** | *out* | *v* | |
40 |
41 |
42 | #### Set
43 |
44 |
45 |
46 | ##### Arguments
47 |
48 | | Name | Direction | Type | Description |
49 | | --- | :---: | :---: | --- |
50 | | **interface\_name** | *in* | *s* | |
51 | | **property\_name** | *in* | *s* | |
52 | | **value** | *in* | *v* | |
53 |
54 |
55 | #### GetAll
56 |
57 |
58 |
59 | ##### Arguments
60 |
61 | | Name | Direction | Type | Description |
62 | | --- | :---: | :---: | --- |
63 | | **interface\_name** | *in* | *s* | |
64 | | **** | *out* | *a{sv}* | |
65 |
66 |
67 |
68 | ### Signals
69 |
70 | #### PropertiesChanged
71 |
72 |
73 |
74 | ##### Arguments
75 |
76 | | Name | Direction | Type | Description |
77 | | --- | :---: | :---: | --- |
78 | | **interface\_name** | ** | *s* | |
79 | | **changed\_properties** | ** | *a{sv}* | |
80 | | **invalidated\_properties** | ** | *as* | |
81 |
82 |
83 | ## org.freedesktop.DBus.Introspectable
84 |
85 | ### Methods
86 |
87 | #### Introspect
88 |
89 |
90 |
91 | ##### Arguments
92 |
93 | | Name | Direction | Type | Description |
94 | | --- | :---: | :---: | --- |
95 | | **** | *out* | *s* | |
96 |
97 |
98 |
99 | ### Signals
100 |
101 | ## org.freedesktop.DBus.Peer
102 |
103 | ### Methods
104 |
105 | #### Ping
106 |
107 |
108 |
109 |
110 | #### GetMachineId
111 |
112 |
113 |
114 | ##### Arguments
115 |
116 | | Name | Direction | Type | Description |
117 | | --- | :---: | :---: | --- |
118 | | **** | *out* | *s* | |
119 |
120 |
121 |
122 | ### Signals
123 |
--------------------------------------------------------------------------------
/docs/target_dbus.md:
--------------------------------------------------------------------------------
1 |
2 | # DBusDevice DBus Interface API
3 |
4 | ## org.freedesktop.DBus.Introspectable
5 |
6 | ### Methods
7 |
8 | #### Introspect
9 |
10 |
11 |
12 | ##### Arguments
13 |
14 | | Name | Direction | Type | Description |
15 | | --- | :---: | :---: | --- |
16 | | **** | *out* | *s* | |
17 |
18 |
19 |
20 | ### Signals
21 |
22 | ## org.shadowblip.Input.DBusDevice
23 |
24 | ### Properties
25 |
26 |
27 | | Name | Access | Type | Description |
28 | | --- | :---: | :---: | --- |
29 | | **Name** | *read* | *s* | |
30 |
31 | ### Methods
32 |
33 |
34 | ### Signals
35 |
36 | #### InputEvent
37 |
38 |
39 |
40 | ##### Arguments
41 |
42 | | Name | Direction | Type | Description |
43 | | --- | :---: | :---: | --- |
44 | | **event** | ** | *s* | |
45 | | **value** | ** | *d* | |
46 |
47 |
48 | ## org.freedesktop.DBus.Peer
49 |
50 | ### Methods
51 |
52 | #### Ping
53 |
54 |
55 |
56 |
57 | #### GetMachineId
58 |
59 |
60 |
61 | ##### Arguments
62 |
63 | | Name | Direction | Type | Description |
64 | | --- | :---: | :---: | --- |
65 | | **** | *out* | *s* | |
66 |
67 |
68 |
69 | ### Signals
70 |
71 | ## org.freedesktop.DBus.Properties
72 |
73 | ### Methods
74 |
75 | #### Get
76 |
77 |
78 |
79 | ##### Arguments
80 |
81 | | Name | Direction | Type | Description |
82 | | --- | :---: | :---: | --- |
83 | | **interface\_name** | *in* | *s* | |
84 | | **property\_name** | *in* | *s* | |
85 | | **** | *out* | *v* | |
86 |
87 |
88 | #### Set
89 |
90 |
91 |
92 | ##### Arguments
93 |
94 | | Name | Direction | Type | Description |
95 | | --- | :---: | :---: | --- |
96 | | **interface\_name** | *in* | *s* | |
97 | | **property\_name** | *in* | *s* | |
98 | | **value** | *in* | *v* | |
99 |
100 |
101 | #### GetAll
102 |
103 |
104 |
105 | ##### Arguments
106 |
107 | | Name | Direction | Type | Description |
108 | | --- | :---: | :---: | --- |
109 | | **interface\_name** | *in* | *s* | |
110 | | **** | *out* | *a{sv}* | |
111 |
112 |
113 |
114 | ### Signals
115 |
116 | #### PropertiesChanged
117 |
118 |
119 |
120 | ##### Arguments
121 |
122 | | Name | Direction | Type | Description |
123 | | --- | :---: | :---: | --- |
124 | | **interface\_name** | ** | *s* | |
125 | | **changed\_properties** | ** | *a{sv}* | |
126 | | **invalidated\_properties** | ** | *as* | |
127 |
128 |
--------------------------------------------------------------------------------
/docs/target_gamepad.md:
--------------------------------------------------------------------------------
1 |
2 | # Gamepad DBus Interface API
3 |
4 | ## org.freedesktop.DBus.Peer
5 |
6 | ### Methods
7 |
8 | #### Ping
9 |
10 |
11 |
12 |
13 | #### GetMachineId
14 |
15 |
16 |
17 | ##### Arguments
18 |
19 | | Name | Direction | Type | Description |
20 | | --- | :---: | :---: | --- |
21 | | **** | *out* | *s* | |
22 |
23 |
24 |
25 | ### Signals
26 |
27 | ## org.freedesktop.DBus.Properties
28 |
29 | ### Methods
30 |
31 | #### Get
32 |
33 |
34 |
35 | ##### Arguments
36 |
37 | | Name | Direction | Type | Description |
38 | | --- | :---: | :---: | --- |
39 | | **interface\_name** | *in* | *s* | |
40 | | **property\_name** | *in* | *s* | |
41 | | **** | *out* | *v* | |
42 |
43 |
44 | #### Set
45 |
46 |
47 |
48 | ##### Arguments
49 |
50 | | Name | Direction | Type | Description |
51 | | --- | :---: | :---: | --- |
52 | | **interface\_name** | *in* | *s* | |
53 | | **property\_name** | *in* | *s* | |
54 | | **value** | *in* | *v* | |
55 |
56 |
57 | #### GetAll
58 |
59 |
60 |
61 | ##### Arguments
62 |
63 | | Name | Direction | Type | Description |
64 | | --- | :---: | :---: | --- |
65 | | **interface\_name** | *in* | *s* | |
66 | | **** | *out* | *a{sv}* | |
67 |
68 |
69 |
70 | ### Signals
71 |
72 | #### PropertiesChanged
73 |
74 |
75 |
76 | ##### Arguments
77 |
78 | | Name | Direction | Type | Description |
79 | | --- | :---: | :---: | --- |
80 | | **interface\_name** | ** | *s* | |
81 | | **changed\_properties** | ** | *a{sv}* | |
82 | | **invalidated\_properties** | ** | *as* | |
83 |
84 |
85 | ## org.freedesktop.DBus.Introspectable
86 |
87 | ### Methods
88 |
89 | #### Introspect
90 |
91 |
92 |
93 | ##### Arguments
94 |
95 | | Name | Direction | Type | Description |
96 | | --- | :---: | :---: | --- |
97 | | **** | *out* | *s* | |
98 |
99 |
100 |
101 | ### Signals
102 |
103 | ## org.shadowblip.Input.Gamepad
104 |
105 | ### Properties
106 |
107 |
108 | | Name | Access | Type | Description |
109 | | --- | :---: | :---: | --- |
110 | | **Name** | *read* | *s* | |
111 |
112 | ### Methods
113 |
114 |
115 | ### Signals
116 |
--------------------------------------------------------------------------------
/docs/target_keyboard.md:
--------------------------------------------------------------------------------
1 |
2 | # Keyboard DBus Interface API
3 |
4 | ## org.freedesktop.DBus.Introspectable
5 |
6 | ### Methods
7 |
8 | #### Introspect
9 |
10 |
11 |
12 | ##### Arguments
13 |
14 | | Name | Direction | Type | Description |
15 | | --- | :---: | :---: | --- |
16 | | **** | *out* | *s* | |
17 |
18 |
19 |
20 | ### Signals
21 |
22 | ## org.freedesktop.DBus.Properties
23 |
24 | ### Methods
25 |
26 | #### Get
27 |
28 |
29 |
30 | ##### Arguments
31 |
32 | | Name | Direction | Type | Description |
33 | | --- | :---: | :---: | --- |
34 | | **interface\_name** | *in* | *s* | |
35 | | **property\_name** | *in* | *s* | |
36 | | **** | *out* | *v* | |
37 |
38 |
39 | #### Set
40 |
41 |
42 |
43 | ##### Arguments
44 |
45 | | Name | Direction | Type | Description |
46 | | --- | :---: | :---: | --- |
47 | | **interface\_name** | *in* | *s* | |
48 | | **property\_name** | *in* | *s* | |
49 | | **value** | *in* | *v* | |
50 |
51 |
52 | #### GetAll
53 |
54 |
55 |
56 | ##### Arguments
57 |
58 | | Name | Direction | Type | Description |
59 | | --- | :---: | :---: | --- |
60 | | **interface\_name** | *in* | *s* | |
61 | | **** | *out* | *a{sv}* | |
62 |
63 |
64 |
65 | ### Signals
66 |
67 | #### PropertiesChanged
68 |
69 |
70 |
71 | ##### Arguments
72 |
73 | | Name | Direction | Type | Description |
74 | | --- | :---: | :---: | --- |
75 | | **interface\_name** | ** | *s* | |
76 | | **changed\_properties** | ** | *a{sv}* | |
77 | | **invalidated\_properties** | ** | *as* | |
78 |
79 |
80 | ## org.shadowblip.Input.Keyboard
81 |
82 | ### Properties
83 |
84 |
85 | | Name | Access | Type | Description |
86 | | --- | :---: | :---: | --- |
87 | | **Name** | *read* | *s* | |
88 |
89 | ### Methods
90 |
91 | #### SendKey
92 |
93 |
94 |
95 | ##### Arguments
96 |
97 | | Name | Direction | Type | Description |
98 | | --- | :---: | :---: | --- |
99 | | **key** | *in* | *s* | |
100 | | **value** | *in* | *b* | |
101 |
102 |
103 |
104 | ### Signals
105 |
106 | ## org.freedesktop.DBus.Peer
107 |
108 | ### Methods
109 |
110 | #### Ping
111 |
112 |
113 |
114 |
115 | #### GetMachineId
116 |
117 |
118 |
119 | ##### Arguments
120 |
121 | | Name | Direction | Type | Description |
122 | | --- | :---: | :---: | --- |
123 | | **** | *out* | *s* | |
124 |
125 |
126 |
127 | ### Signals
128 |
--------------------------------------------------------------------------------
/docs/target_mouse.md:
--------------------------------------------------------------------------------
1 |
2 | # Mouse DBus Interface API
3 |
4 | ## org.freedesktop.DBus.Peer
5 |
6 | ### Methods
7 |
8 | #### Ping
9 |
10 |
11 |
12 |
13 | #### GetMachineId
14 |
15 |
16 |
17 | ##### Arguments
18 |
19 | | Name | Direction | Type | Description |
20 | | --- | :---: | :---: | --- |
21 | | **** | *out* | *s* | |
22 |
23 |
24 |
25 | ### Signals
26 |
27 | ## org.shadowblip.Input.Mouse
28 |
29 | ### Properties
30 |
31 |
32 | | Name | Access | Type | Description |
33 | | --- | :---: | :---: | --- |
34 | | **Name** | *read* | *s* | |
35 |
36 | ### Methods
37 |
38 |
39 | ### Signals
40 |
41 | ## org.freedesktop.DBus.Introspectable
42 |
43 | ### Methods
44 |
45 | #### Introspect
46 |
47 |
48 |
49 | ##### Arguments
50 |
51 | | Name | Direction | Type | Description |
52 | | --- | :---: | :---: | --- |
53 | | **** | *out* | *s* | |
54 |
55 |
56 |
57 | ### Signals
58 |
59 | ## org.freedesktop.DBus.Properties
60 |
61 | ### Methods
62 |
63 | #### Get
64 |
65 |
66 |
67 | ##### Arguments
68 |
69 | | Name | Direction | Type | Description |
70 | | --- | :---: | :---: | --- |
71 | | **interface\_name** | *in* | *s* | |
72 | | **property\_name** | *in* | *s* | |
73 | | **** | *out* | *v* | |
74 |
75 |
76 | #### Set
77 |
78 |
79 |
80 | ##### Arguments
81 |
82 | | Name | Direction | Type | Description |
83 | | --- | :---: | :---: | --- |
84 | | **interface\_name** | *in* | *s* | |
85 | | **property\_name** | *in* | *s* | |
86 | | **value** | *in* | *v* | |
87 |
88 |
89 | #### GetAll
90 |
91 |
92 |
93 | ##### Arguments
94 |
95 | | Name | Direction | Type | Description |
96 | | --- | :---: | :---: | --- |
97 | | **interface\_name** | *in* | *s* | |
98 | | **** | *out* | *a{sv}* | |
99 |
100 |
101 |
102 | ### Signals
103 |
104 | #### PropertiesChanged
105 |
106 |
107 |
108 | ##### Arguments
109 |
110 | | Name | Direction | Type | Description |
111 | | --- | :---: | :---: | --- |
112 | | **interface\_name** | ** | *s* | |
113 | | **changed\_properties** | ** | *a{sv}* | |
114 | | **invalidated\_properties** | ** | *as* | |
115 |
116 |
--------------------------------------------------------------------------------
/examples/unified_gamepad/main.rs:
--------------------------------------------------------------------------------
1 | use std::{fs, thread::sleep, time::Duration};
2 |
3 | use inputplumber::drivers::unified_gamepad::driver::Driver;
4 |
5 | const SEARCH_PATH: &str = "/sys/bus/hid/devices";
6 |
7 | fn main() {
8 | // Look for a Unified Controller
9 | let paths = fs::read_dir(SEARCH_PATH).expect("Unable to read HID devices");
10 |
11 | println!("Searching for Unified Controller");
12 | let mut device_sys_path = None;
13 | for path in paths {
14 | let path = path.unwrap();
15 | let mut file_path = path.path().into_os_string();
16 | file_path.push("/uevent");
17 | println!("{file_path:?}");
18 |
19 | let data = fs::read_to_string(file_path).unwrap();
20 | println!("{data}");
21 | if data.contains("InputPlumber Unified Gamepad") {
22 | device_sys_path = Some(path);
23 | break;
24 | }
25 | }
26 |
27 | // Get the hidraw name of the device
28 | let device_sys_path = device_sys_path.expect("Unable to find Unified Controller");
29 | let mut hid_sys_path = device_sys_path.path().into_os_string();
30 | hid_sys_path.push("/hidraw");
31 | let paths = fs::read_dir(hid_sys_path).expect("Unable to read HID device info");
32 | let device_name = paths.into_iter().next().unwrap().unwrap().file_name();
33 |
34 | println!("Found Unified Controller device: {device_name:?}");
35 | println!("Starting Unified Controller driver!");
36 |
37 | let path = format!("/dev/{}", device_name.to_string_lossy());
38 | let mut driver = Driver::new(path).expect("Failed to create driver instance");
39 |
40 | loop {
41 | let events = driver.poll().expect("Failed to poll device");
42 | for event in events.into_iter() {
43 | println!("Event: {event:?}");
44 | }
45 | sleep(Duration::from_millis(1));
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/pkg/archlinux/PKGBUILD:
--------------------------------------------------------------------------------
1 | # Maintainer: William Edwards
2 | pkgname=inputplumber-bin
3 | _pkgbase=inputplumber
4 | pkgver=v0.58.2
5 | pkgrel=1
6 | pkgdesc="Open source input router and remapper daemon for Linux"
7 | arch=('x86_64')
8 | url="https://github.com/ShadowBlip/inputplumber"
9 | license=('GPL')
10 | depends=('dbus' 'libevdev' 'libiio')
11 | provides=('inputplumber')
12 | conflicts=('inputplumber-git')
13 | source=(inputplumber-$pkgver.tar.gz::https://github.com/ShadowBlip/inputplumber/releases/download/$pkgver/inputplumber-x86_64.tar.gz)
14 |
15 | sha256sums=('8cd5c450a88106132c52a8db99919d53d647dac8aeae2c9e4f411cd95150645d')
16 |
17 | prepare() {
18 | cd "$srcdir/${_pkgbase}"
19 | }
20 |
21 | package() {
22 | cd "$srcdir/${_pkgbase}"
23 | cp -r ./* ${pkgdir}
24 | }
25 |
--------------------------------------------------------------------------------
/rootfs/usr/lib/systemd/system/inputplumber-suspend.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=InputPlumber Suspend Inhibit Service
3 | Before=sleep.target
4 | StopWhenUnneeded=yes
5 |
6 | [Service]
7 | Type=oneshot
8 | RemainAfterExit=yes
9 | ExecStart=busctl call org.shadowblip.InputPlumber /org/shadowblip/InputPlumber/Manager org.shadowblip.InputManager HookSleep
10 | ExecStop=busctl call org.shadowblip.InputPlumber /org/shadowblip/InputPlumber/Manager org.shadowblip.InputManager HookWake
11 |
12 | [Install]
13 | WantedBy=sleep.target
14 |
--------------------------------------------------------------------------------
/rootfs/usr/lib/systemd/system/inputplumber.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=InputPlumber Service
3 |
4 | [Service]
5 | Type=dbus
6 | BusName=org.shadowblip.InputPlumber
7 | Environment=LOG_LEVEL=info
8 | ExecStart=/usr/bin/inputplumber
9 |
10 | [Install]
11 | WantedBy=multi-user.target
12 |
--------------------------------------------------------------------------------
/rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb:
--------------------------------------------------------------------------------
1 | # AYANEO Devices
2 | evdev:name:AT Translated Set 2 keyboard:dmi:*:svnAYANEO:*
3 | KEYBOARD_KEY_66=f15
4 | KEYBOARD_KEY_67=f16
5 | KEYBOARD_KEY_68=f17
6 | KEYBOARD_KEY_69=f18
7 |
8 | # OrangePi Devices
9 | evdev:name:AT Translated Set 2 keyboard:dmi:*:svnOrangePi:pnNEO-01:*
10 | KEYBOARD_KEY_66=f15
11 | KEYBOARD_KEY_67=f16
12 |
13 | # Unified Gamepad
14 | hid:b0003g0001v00001D50p0000616A
15 | ID_INPUT_UNIFIED=1
16 |
--------------------------------------------------------------------------------
/rootfs/usr/lib/udev/rules.d/90-inputplumber-autostart.rules:
--------------------------------------------------------------------------------
1 | ENV{USE_INPUTPLUMBER}=="1", TAG+="uaccess", TAG+="systemd", ENV{SYSTEMD_WANTS}+="inputplumber.service"
2 |
--------------------------------------------------------------------------------
/rootfs/usr/share/dbus-1/system-services/org.shadowblip.InputPlumber.service:
--------------------------------------------------------------------------------
1 | [D-BUS Service]
2 | Name=com.github.guelfey.Demo
3 | User=${USER}
4 | Exec=/tmp/dbus-demo-server
5 |
--------------------------------------------------------------------------------
/rootfs/usr/share/dbus-1/system.d/org.shadowblip.InputPlumber.conf:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/ally_type1.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: Ally Type 1
10 |
11 | # Unique identifier of the capability mapping
12 | id: aly1
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Control Center (Short)
17 | source_events:
18 | - keyboard: KeyF16
19 | target_event:
20 | gamepad:
21 | button: Guide
22 | - name: Control Center (Long)
23 | source_events:
24 | - keyboard: KeyLeftCtrl
25 | - keyboard: KeyLeftAlt
26 | - keyboard: KeyDelete
27 | target_event:
28 | gamepad:
29 | button: Keyboard
30 | - name: Control Center (Long)
31 | source_events:
32 | - keyboard: KeyF20
33 | target_event:
34 | gamepad:
35 | button: Keyboard
36 | - name: Armory Crate (Short)
37 | source_events:
38 | - keyboard: KeyProg1
39 | target_event:
40 | gamepad:
41 | button: QuickAccess
42 | - name: Armory Crate (Short)
43 | source_events:
44 | - keyboard: KeyF19
45 | target_event:
46 | gamepad:
47 | button: QuickAccess
48 | - name: Armory Crate (Long)
49 | source_events:
50 | - keyboard: KeyF17
51 | target_event:
52 | gamepad:
53 | button: QuickAccess2
54 | - name: Left Paddle
55 | source_events:
56 | - keyboard: KeyF14
57 | target_event:
58 | gamepad:
59 | button: LeftPaddle1
60 | - name: Right Paddle
61 | source_events:
62 | - keyboard: KeyF15
63 | target_event:
64 | gamepad:
65 | button: RightPaddle1
66 |
67 | # List of events to filter from the source devices
68 | filtered_events: []
69 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/anbernic_type1.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: Anbernic Type 1
10 |
11 | # Unique identifier of the capability mapping
12 | id: anb1
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Home (Short Press)
17 | source_events:
18 | - keyboard: KeyG
19 | - keyboard: KeyLeftMeta
20 | target_event:
21 | gamepad:
22 | button: Guide
23 | # Workaround to enable Guide chording.
24 | - name: Home (Long Press)
25 | source_events:
26 | - keyboard: KeyEsc
27 | target_event:
28 | gamepad:
29 | button: Guide
30 | - name: Keyboard
31 | source_events:
32 | - keyboard: KeyO
33 | - keyboard: KeyLeftCtrl
34 | - keyboard: KeyLeftMeta
35 | target_event:
36 | gamepad:
37 | button: Keyboard
38 | # Windows short press seems to break things currently, so disabled for now.
39 | # - name: Windows (Short Press)
40 | # source_events:
41 | # - keyboard: KeyLeftMeta
42 | # target_event:
43 | # gamepad:
44 | # button: QuickAccess
45 | - name: Windows (Long Press)
46 | source_events:
47 | - keyboard: KeyEsc
48 | - keyboard: KeyLeftShift
49 | - keyboard: KeyLeftCtrl
50 | target_event:
51 | gamepad:
52 | button: QuickAccess
53 |
54 | # List of events to filter from the source devices
55 | filtered_events: []
56 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type1.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: AYANEO Type 1
10 |
11 | # Unique identifier of the capability mapping
12 | id: aya1
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | #TODO: Figure out how to use this and also KB.
17 | #- name: Win
18 | # source_events:
19 | # - keyboard: KeyLeftMeta
20 | # target_event:
21 | # gamepad:
22 | # button: Screenshot
23 | - name: Task Manager
24 | source_events:
25 | - keyboard: KeyRightCtrl
26 | - keyboard: KeyRightAlt
27 | - keyboard: KeyDelete
28 | target_event:
29 | gamepad:
30 | button: QuickAccess
31 | - name: Keyboard
32 | source_events:
33 | - keyboard: KeyO
34 | - keyboard: KeyRightCtrl
35 | - keyboard: KeyLeftMeta
36 | target_event:
37 | gamepad:
38 | button: Keyboard
39 | - name: Escape
40 | source_events:
41 | - keyboard: KeyEsc
42 | target_event:
43 | gamepad:
44 | button: QuickAccess2
45 |
46 | # List of events to filter from the source devices
47 | filtered_events: []
48 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type2.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: AYANEO Type 2
10 |
11 | # Unique identifier of the capability mapping
12 | id: aya2
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Custom v1
17 | source_events:
18 | - keyboard: KeyApostrophe
19 | - keyboard: KeyCopy
20 | target_event:
21 | gamepad:
22 | button: QuickAccess
23 | - name: Custom v2
24 | source_events:
25 | - keyboard: KeyD
26 | - keyboard: KeyLeftMeta
27 | target_event:
28 | gamepad:
29 | button: QuickAccess
30 | - name: Aya Space v1
31 | source_events:
32 | - keyboard: KeyKpEnter
33 | - keyboard: KeyLeft
34 | - keyboard: KeyCopy
35 | target_event:
36 | gamepad:
37 | button: Guide
38 | - name: Aya Space v2
39 | source_events:
40 | - keyboard: KeyF12
41 | - keyboard: KeyRightCtrl
42 | - keyboard: KeyLeftMeta
43 | target_event:
44 | gamepad:
45 | button: Guide
46 |
47 | # List of events to filter from the source devices
48 | filtered_events: []
49 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type3.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: AYANEO Type 3
10 |
11 | # Unique identifier of the capability mapping
12 | id: aya3
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Custom
17 | source_events:
18 | - keyboard: KeyD
19 | - keyboard: KeyLeftMeta
20 | target_event:
21 | gamepad:
22 | button: QuickAccess
23 | - name: Aya Space
24 | source_events:
25 | - keyboard: KeyF12
26 | - keyboard: KeyRightCtrl
27 | - keyboard: KeyLeftMeta
28 | target_event:
29 | gamepad:
30 | button: Guide
31 | - name: LC
32 | source_events:
33 | - keyboard: KeyF11
34 | - keyboard: KeyRightCtrl
35 | - keyboard: KeyLeftMeta
36 | target_event:
37 | gamepad:
38 | button: LeftTop
39 | - name: RC
40 | source_events:
41 | - keyboard: KeyF10
42 | - keyboard: KeyRightCtrl
43 | - keyboard: KeyLeftMeta
44 | target_event:
45 | gamepad:
46 | button: RightTop
47 |
48 | # List of events to filter from the source devices
49 | filtered_events: []
50 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type4.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: AYANEO Type 4
10 |
11 | # Unique identifier of the capability mapping
12 | id: aya4
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Custom
17 | source_events:
18 | - keyboard: KeyD
19 | - keyboard: KeyLeftMeta
20 | target_event:
21 | gamepad:
22 | button: QuickAccess
23 | - name: Aya Space
24 | source_events:
25 | - keyboard: KeyRightCtrl
26 | - keyboard: KeyLeftMeta
27 | - keyboard: KeyF17
28 | target_event:
29 | gamepad:
30 | button: Guide
31 | - name: LC
32 | source_events:
33 | - keyboard: KeyRightCtrl
34 | - keyboard: KeyLeftMeta
35 | - keyboard: KeyF15
36 | target_event:
37 | gamepad:
38 | button: LeftTop
39 | - name: RC
40 | source_events:
41 | - keyboard: KeyRightCtrl
42 | - keyboard: KeyLeftMeta
43 | - keyboard: KeyF16
44 | target_event:
45 | gamepad:
46 | button: RightTop
47 | - name: Secondary Screen Interaction
48 | source_events:
49 | - keyboard: KeyRightCtrl
50 | - keyboard: KeyLeftMeta
51 | - keyboard: KeyF18
52 | target_event:
53 | gamepad:
54 | button: Keyboard
55 |
56 | # List of events to filter from the source devices
57 | filtered_events: []
58 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type5.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: AYANEO Type 5
10 |
11 | # Unique identifier of the capability mapping
12 | id: aya5
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Custom
17 | source_events:
18 | - keyboard: KeyD
19 | - keyboard: KeyLeftMeta
20 | target_event:
21 | gamepad:
22 | button: QuickAccess
23 | - name: Aya Space
24 | source_events:
25 | - keyboard: KeyLeftCtrl
26 | - keyboard: KeyLeftMeta
27 | - keyboard: KeyF17
28 | target_event:
29 | gamepad:
30 | button: Guide
31 | - name: LC
32 | source_events:
33 | - keyboard: KeyLeftCtrl
34 | - keyboard: KeyLeftMeta
35 | - keyboard: KeyF15
36 | target_event:
37 | gamepad:
38 | button: LeftTop
39 | - name: RC
40 | source_events:
41 | - keyboard: KeyLeftCtrl
42 | - keyboard: KeyLeftMeta
43 | - keyboard: KeyF16
44 | target_event:
45 | gamepad:
46 | button: RightTop
47 |
48 | # List of events to filter from the source devices
49 | filtered_events: []
50 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type6.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: AYANEO Type 6
10 |
11 | # Unique identifier of the capability mapping
12 | id: aya6
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Custom
17 | source_events:
18 | - keyboard: KeyD
19 | - keyboard: KeyLeftMeta
20 | target_event:
21 | gamepad:
22 | button: QuickAccess
23 | - name: Aya Space
24 | source_events:
25 | - keyboard: KeyRightCtrl
26 | - keyboard: KeyLeftMeta
27 | - keyboard: KeyF17
28 | target_event:
29 | gamepad:
30 | button: QuickAccess2
31 | - name: LC
32 | source_events:
33 | - keyboard: KeyRightCtrl
34 | - keyboard: KeyLeftMeta
35 | - keyboard: KeyF15
36 | target_event:
37 | gamepad:
38 | button: LeftTop
39 | - name: RC
40 | source_events:
41 | - keyboard: KeyRightCtrl
42 | - keyboard: KeyLeftMeta
43 | - keyboard: KeyF16
44 | target_event:
45 | gamepad:
46 | button: RightTop
47 | - name: T
48 | source_events:
49 | - keyboard: KeyRightCtrl
50 | - keyboard: KeyLeftMeta
51 | - keyboard: KeyF18
52 | target_event:
53 | gamepad:
54 | button: RightTop #TODO: Add FrontRightTop to schema
55 |
56 | # List of events to filter from the source devices
57 | filtered_events: []
58 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/ayn_type1.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: AYN Type 1
10 |
11 | # Unique identifier of the capability mapping
12 | id: ayn1
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Lower Right
17 | source_events:
18 | - keyboard: KeyT
19 | - keyboard: KeyLeftCtrl
20 | - keyboard: KeyLeftShift
21 | - keyboard: KeyLeftAlt
22 | target_event:
23 | gamepad:
24 | button: QuickAccess
25 | - name: Lower Left + Lower Right
26 | source_events:
27 | - keyboard: KeyDelete
28 | target_event:
29 | gamepad:
30 | button: QuickAccess2
31 |
32 | # List of events to filter from the source devices
33 | filtered_events: []
34 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/flydigi_vader_4_pro.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 | # The type of configuration schema
5 | kind: CapabilityMap
6 |
7 | # Name for the device event map
8 | name: flydigi-vader-4-pro
9 |
10 | # Unique identifier of the capability mapping
11 | id: flydigi-vader-4-pro
12 |
13 | # List of mapped events that are activated by a specific set of activation keys.
14 | mapping:
15 | - name: LeftPaddle3
16 | source_events:
17 | - gamepad:
18 | button: LeftPaddle3
19 | target_event:
20 | touchpad:
21 | name: LeftPad
22 | touch:
23 | button: Touch
24 | - name: RightPaddle3
25 | source_events:
26 | - gamepad:
27 | button: RightPaddle3
28 | target_event:
29 | touchpad:
30 | name: RightPad
31 | touch:
32 | button: Touch
33 |
34 | # List of events to filter from the source devices
35 | filtered_events: []
36 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/gpd_type1.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: GPD Type 1
10 |
11 | # Unique identifier of the capability mapping
12 | id: gpd1
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Left Paddle
17 | source_events:
18 | - keyboard: KeyLeftCtrl
19 | - keyboard: KeyLeftAlt
20 | - keyboard: KeyDelete
21 | target_event:
22 | gamepad:
23 | button: LeftPaddle1
24 | - name: Right Paddle
25 | source_events:
26 | - keyboard: KeyEsc
27 | target_event:
28 | gamepad:
29 | button: RightPaddle1
30 |
31 | # List of events to filter from the source devices
32 | filtered_events: []
33 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/gpd_type2.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: GPD Type 2
10 |
11 | # Unique identifier of the capability mapping
12 | id: gpd2
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Left Paddle
17 | source_events:
18 | - keyboard: Key0
19 | target_event:
20 | gamepad:
21 | button: LeftPaddle1
22 | - name: Right Paddle
23 | source_events:
24 | - keyboard: Key9
25 | target_event:
26 | gamepad:
27 | button: RightPaddle1
28 |
29 | # List of events to filter from the source devices
30 | filtered_events: []
31 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/gpd_type3.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: GPD Type 3
10 |
11 | # Unique identifier of the capability mapping
12 | id: gpd3
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Left Paddle
17 | source_events:
18 | - keyboard: KeySysrq
19 | target_event:
20 | gamepad:
21 | button: LeftPaddle1
22 | - name: Right Paddle
23 | source_events:
24 | - keyboard: KeyPause
25 | target_event:
26 | gamepad:
27 | button: RightPaddle1
28 |
29 | # List of events to filter from the source devices
30 | filtered_events: []
31 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/imu_generic.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v2.json
2 | # Schema version number
3 | version: 2
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: Generic IMU
10 |
11 | # Unique identifier of the capability mapping
12 | id: imu_generic
13 |
14 | # List of mapped events
15 | mapping:
16 | - name: Accelerometer
17 | source_events:
18 | - evdev:
19 | event_type: ABS
20 | event_code: ABS_X
21 | value_type: imu_x
22 | - evdev:
23 | event_type: ABS
24 | event_code: ABS_Y
25 | value_type: imu_y
26 | - evdev:
27 | event_type: ABS
28 | event_code: ABS_Z
29 | value_type: imu_z
30 | target_event:
31 | gamepad:
32 | accelerometer:
33 | name: Accelerometer
34 |
35 | - name: Gyro
36 | source_events:
37 | - evdev:
38 | event_type: ABS
39 | event_code: ABS_RX
40 | value_type: imu_x
41 | - evdev:
42 | event_type: ABS
43 | event_code: ABS_RY
44 | value_type: imu_y
45 | - evdev:
46 | event_type: ABS
47 | event_code: ABS_RZ
48 | value_type: imu_z
49 | target_event:
50 | gamepad:
51 | gyro:
52 | name: Gyro
53 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/msiclaw_type1.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: MSI Claw Type 1
10 |
11 | # Unique identifier of the capability mapping
12 | id: claw1
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Guide
17 | source_events:
18 | - keyboard: KeyF15
19 | target_event:
20 | gamepad:
21 | button: Guide
22 | - name: QuickAccess
23 | source_events:
24 | - keyboard: KeyF16
25 | target_event:
26 | gamepad:
27 | button: QuickAccess
28 |
29 | # List of events to filter from the source devices
30 | filtered_events: []
31 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type1.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: OneXPlayer Type 1
10 |
11 | # Unique identifier of the capability mapping
12 | id: oxp1
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: KB (Short Press)
17 | source_events:
18 | - keyboard: KeyRightCtrl
19 | - keyboard: KeyLeftMeta
20 | - keyboard: KeyO
21 | target_event:
22 | gamepad:
23 | button: Keyboard
24 | - name: Orange Button (Short Press)
25 | source_events:
26 | - keyboard: KeyLeftMeta
27 | - keyboard: KeyD
28 | target_event:
29 | gamepad:
30 | button: QuickAccess
31 | - name: Turbo + Orange Button
32 | source_events:
33 | - keyboard: KeyLeftMeta
34 | - keyboard: KeySysrq
35 | target_event:
36 | gamepad:
37 | button: QuickAccess2
38 | - name: KB + Orange Button
39 | source_events:
40 | - keyboard: KeyRightCtrl
41 | - keyboard: KeyRightAlt
42 | - keyboard: KeyDelete
43 | target_event:
44 | gamepad:
45 | button: Screenshot
46 |
47 | # List of events to filter from the source devices
48 | filtered_events: []
49 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type2.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: OneXPlayer Type 2
10 |
11 | # Unique identifier of the capability mapping
12 | id: oxp2
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: KB (Short Press)
17 | source_events:
18 | - keyboard: KeyRightCtrl
19 | - keyboard: KeyLeftMeta
20 | - keyboard: KeyO
21 | target_event:
22 | gamepad:
23 | button: Keyboard
24 | - name: Orange Button (Short Press)
25 | source_events:
26 | - keyboard: KeyLeftMeta
27 | - keyboard: KeyD
28 | target_event:
29 | gamepad:
30 | button: Guide
31 | - name: Orange Button (Long Press)
32 | source_events:
33 | - keyboard: KeyLeftMeta
34 | - keyboard: KeyG
35 | target_event:
36 | gamepad:
37 | button: QuickAccess
38 | - name: Turbo + Orange Button
39 | source_events:
40 | - keyboard: KeyLeftMeta
41 | - keyboard: KeySysrq
42 | target_event:
43 | gamepad:
44 | button: QuickAccess2
45 | - name: KB + Orange Button
46 | source_events:
47 | - keyboard: KeyRightCtrl
48 | - keyboard: KeyRightAlt
49 | - keyboard: KeyDelete
50 | target_event:
51 | gamepad:
52 | button: Screenshot
53 |
54 | # List of events to filter from the source devices
55 | filtered_events: []
56 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type3.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: OneXPlayer Type 3
10 |
11 | # Unique identifier of the capability mapping
12 | id: oxp3
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Turbo
17 | source_events:
18 | - keyboard: KeyLeftCtrl
19 | - keyboard: KeyLeftAlt
20 | - keyboard: KeyLeftMeta
21 | target_event:
22 | gamepad:
23 | button: QuickAccess
24 | - name: KB (Short Press)
25 | source_events:
26 | - keyboard: KeyRightCtrl
27 | - keyboard: KeyLeftMeta
28 | - keyboard: KeyO
29 | target_event:
30 | gamepad:
31 | button: Keyboard
32 | - name: Orange Button (Short Press)
33 | source_events:
34 | - keyboard: KeyLeftMeta
35 | - keyboard: KeyD
36 | target_event:
37 | gamepad:
38 | button: Guide
39 | - name: Orange Button (Long Press)
40 | source_events:
41 | - keyboard: KeyLeftMeta
42 | - keyboard: KeyG
43 | target_event:
44 | gamepad:
45 | button: QuickAccess2
46 | - name: Turbo + Orange Button
47 | source_events:
48 | - keyboard: KeyLeftMeta
49 | - keyboard: KeySysrq
50 | target_event:
51 | gamepad:
52 | button: Screenshot
53 | - name: KB + Orange Button
54 | source_events:
55 | - keyboard: KeyRightCtrl
56 | - keyboard: KeyRightAlt
57 | - keyboard: KeyDelete
58 | target_event:
59 | keyboard: KeyF13
60 |
61 | # List of events to filter from the source devices
62 | filtered_events: []
63 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type4.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: OneXPlayer Type 4
10 |
11 | # Unique identifier of the capability mapping
12 | id: oxp4
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Volume Up
17 | source_events:
18 | - keyboard: KeyLeftMeta
19 | - keyboard: KeyD
20 | target_event:
21 | keyboard: KeyVolumeUp
22 | - name: Volume Down
23 | source_events:
24 | - keyboard: KeyO
25 | - keyboard: KeyLeftCtrl
26 | - keyboard: KeyLeftMeta
27 | target_event:
28 | keyboard: KeyVolumeDown
29 | - name: Turbo
30 | source_events:
31 | - keyboard: KeyLeftCtrl
32 | - keyboard: KeyLeftAlt
33 | - keyboard: KeyLeftMeta
34 | target_event:
35 | gamepad:
36 | button: QuickAccess
37 |
38 | # List of events to filter from the source devices
39 | filtered_events: []
40 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/orangepi_type1.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: OrangePi Type 1
10 |
11 | # Unique identifier of the capability mapping
12 | id: opi1
13 |
14 | # List of mapped events that are activated by a specific set of activation keys.
15 | mapping:
16 | - name: Guide
17 | source_events:
18 | - keyboard: KeyF16
19 | target_event:
20 | gamepad:
21 | button: Guide
22 | - name: QuickAccess
23 | source_events:
24 | - keyboard: KeyF15
25 | target_event:
26 | gamepad:
27 | button: QuickAccess
28 | - name: LC
29 | source_events:
30 | - keyboard: KeyF17
31 | target_event:
32 | gamepad:
33 | button: LeftTop
34 | - name: RC
35 | source_events:
36 | - keyboard: KeyF18
37 | target_event:
38 | gamepad:
39 | button: RightTop
40 |
41 | # List of events to filter from the source devices
42 | filtered_events: []
43 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/capability_maps/swap_west_north.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v2.json
2 | # Schema version number
3 | version: 2
4 |
5 | # The type of configuration schema
6 | kind: CapabilityMap
7 |
8 | # Name for the device event map
9 | name: Swap West and North Buttons
10 |
11 | # Unique identifier of the capability mapping
12 | id: swap_west_north
13 |
14 | # List of mapped events
15 | mapping:
16 | - name: North Button
17 | source_events:
18 | - evdev:
19 | event_type: KEY
20 | event_code: BTN_WEST
21 | value_type: button
22 | target_event:
23 | gamepad:
24 | button: North
25 |
26 | - name: West Button
27 | source_events:
28 | - evdev:
29 | event_type: KEY
30 | event_code: BTN_NORTH
31 | value_type: button
32 | target_event:
33 | gamepad:
34 | button: West
35 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/10-ignore_unsupported.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Ignore Unsupported
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: true
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches: []
18 |
19 | # One or more source devices to combine into a single virtual device. The events
20 | # from these devices will be watched and translated according to the key map.
21 | source_devices:
22 | - group: gamepad
23 | ignore: true
24 | evdev:
25 | handler: js*
26 | - group: mouse
27 | ignore: true
28 | evdev:
29 | handler: mouse*
30 | - group: mouse
31 | ignore: true
32 | evdev:
33 | handler: mice*
34 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-anbernic_win600.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Anbernic Win 600
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: Win600
20 | sys_vendor: Anbernic
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: Microsoft X-Box 360 pad
28 | phys_path: usb-0000:02:00.3-5/input0
29 | handler: event*
30 | - group: keyboard
31 | evdev:
32 | name: AT Translated Set 2 keyboard
33 | phys_path: isa0060/serio0/input0
34 | handler: event*
35 |
36 | # Optional configuration for the composite device
37 | options:
38 | # If true, InputPlumber will automatically try to manage the input device. If
39 | # this is false, InputPlumber will not try to manage the device unless an
40 | # external service enables management of the device. Defaults to 'false'
41 | auto_manage: true
42 |
43 | # The target input device(s) to emulate by default
44 | target_devices:
45 | - xbox-series
46 | - mouse
47 | - keyboard
48 |
49 | # The ID of a device event mapping in the 'event_maps' folder
50 | capability_map_id: anb1
51 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-aokzoe_a1.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: AOKZOE A1
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: AOKZOE A1 AR07
20 | sys_vendor: AOKZOE
21 | - dmi_data:
22 | product_name: AOKZOE A1 Pro
23 | sys_vendor: AOKZOE
24 | - dmi_data:
25 | product_name: AOKZOE A1X
26 | sys_vendor: AOKZOE
27 |
28 | # One or more source devices to combine into a single virtual device. The events
29 | # from these devices will be watched and translated according to the key map.
30 | source_devices:
31 | - group: gamepad
32 | evdev:
33 | name: Microsoft X-Box 360 pad
34 | phys_path: usb-0000:c4:00.3-4/input0
35 | handler: event*
36 | - group: gamepad
37 | evdev:
38 | name: Microsoft X-Box 360 pad
39 | phys_path: usb-0000:e4:00.3-4/input0
40 | handler: event*
41 | - group: gamepad
42 | evdev:
43 | name: Microsoft X-Box 360 pad
44 | phys_path: usb-0000:c7:00.0-3/input0
45 | handler: event*
46 | - group: keyboard
47 | evdev:
48 | name: AT Translated Set 2 keyboard
49 | phys_path: isa0060/serio0/input0
50 | handler: event*
51 | - group: imu
52 | iio:
53 | name: i2c-BMI0160:00
54 |
55 | # Optional configuration for the composite device
56 | options:
57 | # If true, InputPlumber will automatically try to manage the input device. If
58 | # this is false, InputPlumber will not try to manage the device unless an
59 | # external service enables management of the device. Defaults to 'false'
60 | auto_manage: true
61 |
62 | # The target input device(s) to emulate by default
63 | target_devices:
64 | - xbox-series
65 | - mouse
66 | - keyboard
67 |
68 | # The ID of a device event mapping in the 'event_maps' folder
69 | capability_map_id: oxp3
70 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-ayaneo_2021.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: AYANEO 2021
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: AYA NEO FOUNDER
20 | sys_vendor: AYA NEO
21 | - dmi_data:
22 | product_name: AYA NEO 2021
23 | sys_vendor: AYANEO
24 | - dmi_data:
25 | product_name: AYANEO 2021
26 | sys_vendor: AYANEO
27 | - dmi_data:
28 | product_name: AYANEO 2021 Pro
29 | sys_vendor: AYANEO
30 | - dmi_data:
31 | product_name: AYANEO 2021 Pro Retro Power
32 | sys_vendor: AYANEO
33 |
34 | # One or more source devices to combine into a single virtual device. The events
35 | # from these devices will be watched and translated according to the key map.
36 | source_devices:
37 | - group: gamepad
38 | evdev:
39 | name: Microsoft X-Box 360 pad
40 | phys_path: usb-0000:03:00.3-4/input0
41 | handler: event*
42 | - group: keyboard
43 | evdev:
44 | name: AT Translated Set 2 keyboard
45 | phys_path: isa0060/serio0/input0
46 | handler: event*
47 | - group: imu
48 | iio:
49 | name: i2c-10EC5280:00
50 | mount_matrix:
51 | x: [0, -1, 0]
52 | y: [-1, 0, 0]
53 | z: [0, 0, -1]
54 |
55 | # Optional configuration for the composite device
56 | options:
57 | # If true, InputPlumber will automatically try to manage the input device. If
58 | # this is false, InputPlumber will not try to manage the device unless an
59 | # external service enables management of the device. Defaults to 'false'
60 | auto_manage: true
61 |
62 | # The target input device(s) to emulate by default
63 | target_devices:
64 | - xbox-series
65 | - mouse
66 | - keyboard
67 |
68 | # The ID of a device event mapping in the 'event_maps' folder
69 | capability_map_id: aya1
70 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-ayaneo_air.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: AYANEO Air
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: AIR
20 | sys_vendor: AYANEO
21 | - dmi_data:
22 | product_name: AIR Pro
23 | sys_vendor: AYANEO
24 |
25 | # One or more source devices to combine into a single virtual device. The events
26 | # from these devices will be watched and translated according to the key map.
27 | source_devices:
28 | - group: gamepad
29 | evdev:
30 | name: Microsoft X-Box 360 pad
31 | phys_path: usb-0000:04:00.3-4/input0
32 | handler: event*
33 | - group: keyboard
34 | evdev:
35 | name: AT Translated Set 2 keyboard
36 | phys_path: isa0060/serio0/input0
37 | handler: event*
38 | #- group: imu #TODO:reenable after we switch from polling
39 | # iio:
40 | # name: i2c-BMI0160:00
41 | # mount_matrix:
42 | # x: [0, -1, 0]
43 | # y: [-1, 0, 0]
44 | # z: [0, 0, -1]
45 |
46 | #RGB
47 | - group: led
48 | udev: # Legacy
49 | sys_name: multicolor:chassis
50 | subsystem: leds
51 | - group: led
52 | udev: # Updated
53 | sys_name: ayaneo:rgb:joystick_rings
54 | subsystem: leds
55 | # Optional configuration for the composite device
56 | options:
57 | # If true, InputPlumber will automatically try to manage the input device. If
58 | # this is false, InputPlumber will not try to manage the device unless an
59 | # external service enables management of the device. Defaults to 'false'
60 | auto_manage: true
61 |
62 | # The target input device(s) to emulate by default
63 | target_devices:
64 | - xbox-elite
65 | - mouse
66 | - keyboard
67 |
68 | # The ID of a device event mapping in the 'event_maps' folder
69 | capability_map_id: aya3
70 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-ayaneo_air_1s.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: AYANEO AIR 1S
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: AIR 1S
20 | sys_vendor: AYANEO
21 | - dmi_data:
22 | product_name: AIR 1S Limited
23 | sys_vendor: AYANEO
24 |
25 | # One or more source devices to combine into a single virtual device. The events
26 | # from these devices will be watched and translated according to the key map.
27 | source_devices:
28 | - group: gamepad
29 | evdev:
30 | name: Nintendo Co., Ltd. Pro Controller
31 | phys_path: usb-0000:c4:00.3-4/input0
32 | handler: event*
33 | - group: gamepad
34 | evdev:
35 | name: Microsoft X-Box 360 pad
36 | phys_path: usb-0000:c4:00.3-4/input0
37 | handler: event*
38 | - group: keyboard
39 | evdev:
40 | name: AT Translated Set 2 keyboard
41 | phys_path: isa0060/serio0/input0
42 | handler: event*
43 | - group: imu
44 | iio:
45 | name: i2c-BMI0160:00
46 | mount_matrix:
47 | # Tested on Air 1S 8840U
48 | # TODO: Verify on 7840U
49 | x: [0, -1, 0]
50 | y: [-1, 0, 0]
51 | z: [0, 0, -1]
52 |
53 | #RGB
54 | - group: led
55 | udev: # Legacy
56 | sys_name: multicolor:chassis
57 | subsystem: leds
58 | - group: led
59 | udev: # Updated
60 | sys_name: ayaneo:rgb:joystick_rings
61 | subsystem: leds
62 |
63 | # Optional configuration for the composite device
64 | options:
65 | # If true, InputPlumber will automatically try to manage the input device. If
66 | # this is false, InputPlumber will not try to manage the device unless an
67 | # external service enables management of the device. Defaults to 'false'
68 | auto_manage: true
69 |
70 | # The target input device(s) to emulate by default
71 | target_devices:
72 | - xbox-elite
73 | - mouse
74 | - keyboard
75 |
76 | # The ID of a device event mapping in the 'event_maps' folder
77 | capability_map_id: aya4
78 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-ayaneo_air_plus_mendo.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: AYANEO AIR Plus
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: AIR Plus
20 | board_name: AB05-Mendocino
21 | sys_vendor: AYANEO
22 |
23 | # One or more source devices to combine into a single virtual device. The events
24 | # from these devices will be watched and translated according to the key map.
25 | source_devices:
26 | - group: gamepad
27 | evdev:
28 | name: Nintendo Co., Ltd. Pro Controller
29 | phys_path: usb-0000:05:00.0-1/input0
30 | handler: event*
31 | - group: gamepad
32 | evdev:
33 | name: Microsoft X-Box 360 pad
34 | phys_path: usb-0000:05:00.0-1/input0
35 | handler: event*
36 | - group: keyboard
37 | evdev:
38 | name: AT Translated Set 2 keyboard
39 | phys_path: isa0060/serio0/input0
40 | handler: event*
41 | - group: imu
42 | iio:
43 | name: bmi323-imu
44 | mount_matrix:
45 | # TODO: Reverify on actual hardware
46 | x: [0, -1, 0]
47 | y: [-1, 0, 0]
48 | z: [0, 0, 1]
49 |
50 | #RGB
51 | - group: led
52 | udev: # Legacy
53 | sys_name: multicolor:chassis
54 | subsystem: leds
55 | - group: led
56 | udev: # Updated
57 | sys_name: ayaneo:rgb:joystick_rings
58 | subsystem: leds
59 |
60 | # Optional configuration for the composite device
61 | options:
62 | # If true, InputPlumber will automatically try to manage the input device. If
63 | # this is false, InputPlumber will not try to manage the device unless an
64 | # external service enables management of the device. Defaults to 'false'
65 | auto_manage: true
66 |
67 | # The target input device(s) to emulate by default
68 | target_devices:
69 | - xbox-elite
70 | - mouse
71 | - keyboard
72 |
73 | # The ID of a device event mapping in the 'event_maps' folder
74 | capability_map_id: aya4
75 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-ayaneo_kun.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: AYANEO KUN
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: AYANEO KUN
20 | sys_vendor: AYANEO
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: Nintendo Co., Ltd. Pro Controller
28 | phys_path: usb-0000:c4:00.3-4.1/input0
29 | handler: event*
30 | - group: gamepad
31 | evdev:
32 | name: Microsoft X-Box 360 pad
33 | phys_path: usb-0000:c4:00.3-4.1/input0
34 | handler: event*
35 | - group: keyboard
36 | evdev:
37 | name: AT Translated Set 2 keyboard
38 | phys_path: isa0060/serio0/input0
39 | handler: event*
40 | - group: imu
41 | iio:
42 | name: i2c-BMI0160:00
43 |
44 | #RGB
45 | - group: led
46 | udev: # Legacy
47 | sys_name: multicolor:chassis
48 | subsystem: leds
49 | - group: led
50 | udev: # Updated
51 | sys_name: ayaneo:rgb:joystick_rings
52 | subsystem: leds
53 |
54 | # Optional configuration for the composite device
55 | options:
56 | # If true, InputPlumber will automatically try to manage the input device. If
57 | # this is false, InputPlumber will not try to manage the device unless an
58 | # external service enables management of the device. Defaults to 'false'
59 | auto_manage: true
60 |
61 | # The target input device(s) to emulate by default
62 | target_devices:
63 | - xbox-elite
64 | - mouse
65 | - keyboard
66 |
67 | # The ID of a device event mapping in the 'event_maps' folder
68 | capability_map_id: aya6
69 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-ayaneo_next.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: AYANEO NEXT
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: NEXT
20 | sys_vendor: AYANEO
21 | - dmi_data:
22 | product_name: NEXT Advance
23 | sys_vendor: AYANEO
24 | - dmi_data:
25 | product_name: NEXT Lite
26 | sys_vendor: AYANEO
27 | - dmi_data:
28 | product_name: NEXT Pro
29 | sys_vendor: AYANEO
30 | - dmi_data:
31 | product_name: AYANEO NEXT
32 | sys_vendor: AYANEO
33 | - dmi_data:
34 | product_name: AYANEO NEXT Advance
35 | sys_vendor: AYANEO
36 | - dmi_data:
37 | product_name: AYANEO NEXT Pro
38 | sys_vendor: AYANEO
39 |
40 | # One or more source devices to combine into a single virtual device. The events
41 | # from these devices will be watched and translated according to the key map.
42 | source_devices:
43 | - group: gamepad
44 | evdev:
45 | name: Microsoft X-Box 360 pad
46 | phys_path: usb-0000:03:00.3-4/input0
47 | handler: event*
48 | - group: keyboard
49 | evdev:
50 | name: AT Translated Set 2 keyboard
51 | phys_path: isa0060/serio0/input0
52 | handler: event*
53 | - group: imu
54 | iio:
55 | name: i2c-BMI0160:00
56 | mount_matrix:
57 | # TODO: Reverify on actual hardware
58 | x: [0, -1, 0]
59 | y: [1, 0, 0]
60 | z: [0, 0, -1]
61 |
62 | # Optional configuration for the composite device
63 | options:
64 | # If true, InputPlumber will automatically try to manage the input device. If
65 | # this is false, InputPlumber will not try to manage the device unless an
66 | # external service enables management of the device. Defaults to 'false'
67 | auto_manage: true
68 |
69 | # The target input device(s) to emulate by default
70 | target_devices:
71 | - xbox-series
72 | - mouse
73 | - keyboard
74 |
75 | # The ID of a device event mapping in the 'event_maps' folder
76 | capability_map_id: aya2
77 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-ayaneo_slide.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: AYANEO Slide
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: SLIDE
20 | sys_vendor: AYANEO
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: Nintendo Co., Ltd. Pro Controller
28 | phys_path: usb-0000:c4:00.3-3/input0
29 | handler: event*
30 | - group: gamepad
31 | evdev:
32 | name: Microsoft X-Box 360 pad
33 | phys_path: usb-0000:c4:00.3-3/input0
34 | handler: event*
35 | - group: keyboard
36 | evdev:
37 | name: AT Translated Set 2 keyboard
38 | phys_path: isa0060/serio0/input0
39 | handler: event*
40 | - group: imu
41 | iio:
42 | name: i2c-BMI0160:00
43 |
44 | #RGB
45 | - group: led
46 | udev: # Legacy
47 | sys_name: multicolor:chassis
48 | subsystem: leds
49 | - group: led
50 | udev: # Updated
51 | sys_name: ayaneo:rgb:joystick_rings
52 | subsystem: leds
53 |
54 | # Optional configuration for the composite device
55 | options:
56 | # If true, InputPlumber will automatically try to manage the input device. If
57 | # this is false, InputPlumber will not try to manage the device unless an
58 | # external service enables management of the device. Defaults to 'false'
59 | auto_manage: true
60 |
61 | # The target input device(s) to emulate by default
62 | target_devices:
63 | - xbox-elite
64 | - mouse
65 | - keyboard
66 |
67 | # The ID of a device event mapping in the 'event_maps' folder
68 | capability_map_id: aya5
69 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-ayn_loki_max.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: AYN Loki Max
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: Loki Max
20 | sys_vendor: ayn
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: Microsoft X-Box 360 pad
28 | phys_path: usb-0000:74:00.0-1/input0
29 | handler: event*
30 | - group: keyboard
31 | evdev:
32 | name: AT Translated Set 2 keyboard
33 | phys_path: isa0060/serio0/input0
34 | handler: event*
35 | - group: imu
36 | iio:
37 | name: i2c-BMI0160:00
38 | mount_matrix:
39 | x: [1, 0, 0]
40 | y: [0, -1, 0]
41 | z: [0, 0, -1]
42 |
43 | #RGB
44 | - group: led
45 | udev: # Legacy
46 | sys_name: multicolor:chassis
47 | subsystem: leds
48 | - group: led
49 | udev: # Updated
50 | sys_name: ayn:rgb:joystick_rings
51 | subsystem: leds
52 |
53 | # Optional configuration for the composite device
54 | options:
55 | # If true, InputPlumber will automatically try to manage the input device. If
56 | # this is false, InputPlumber will not try to manage the device unless an
57 | # external service enables management of the device. Defaults to 'false'
58 | auto_manage: true
59 |
60 | # The target input device(s) to emulate by default
61 | target_devices:
62 | - xbox-series
63 | - mouse
64 | - keyboard
65 |
66 | # The ID of a device event mapping in the 'event_maps' folder
67 | capability_map_id: ayn1
68 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-ayn_loki_mini_pro.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: AYN Loki MiniPro
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: Loki MiniPro
20 | sys_vendor: ayn
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: Microsoft X-Box 360 pad
28 | phys_path: usb-0000:04:00.4-2/input0
29 | handler: event*
30 | - group: keyboard
31 | evdev:
32 | name: AT Translated Set 2 keyboard
33 | phys_path: isa0060/serio0/input0
34 | handler: event*
35 | - group: imu
36 | iio:
37 | name: i2c-BMI0160:00
38 | mount_matrix:
39 | # TODO: Reverify on actual hardware
40 | x: [1, 0, 0]
41 | y: [0, 1, 0]
42 | z: [0, 0, -1]
43 |
44 | #RGB
45 | - group: led
46 | udev: # Legacy
47 | sys_name: multicolor:chassis
48 | subsystem: leds
49 | - group: led
50 | udev: # Updated
51 | sys_name: ayn:rgb:joystick_rings
52 | subsystem: leds
53 |
54 | # Optional configuration for the composite device
55 | options:
56 | # If true, InputPlumber will automatically try to manage the input device. If
57 | # this is false, InputPlumber will not try to manage the device unless an
58 | # external service enables management of the device. Defaults to 'false'
59 | auto_manage: true
60 |
61 | # The target input device(s) to emulate by default
62 | target_devices:
63 | - xbox-series
64 | - mouse
65 | - keyboard
66 |
67 | # The ID of a device event mapping in the 'event_maps' folder
68 | capability_map_id: ayn1
69 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-ayn_loki_zero.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: AYN Loki Zero
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: Loki Zero
20 | sys_vendor: ayn
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: Microsoft X-Box 360 pad
28 | phys_path: usb-0000:04:00.3-4/input0
29 | handler: event*
30 | - group: keyboard
31 | evdev:
32 | name: AT Translated Set 2 keyboard
33 | phys_path: isa0060/serio0/input0
34 | handler: event*
35 | #- group: imu #TODO:reenable after we switch from polling
36 | # iio:
37 | # name: i2c-BMI0160:00
38 | # mount_matrix:
39 | # # TODO: Reverify on actual hardware
40 | # x: [1, 0, 0]
41 | # y: [0, 1, 0]
42 | # z: [0, 0, -1]
43 |
44 | #RGB
45 | - group: led
46 | udev: # Legacy
47 | sys_name: multicolor:chassis
48 | subsystem: leds
49 | - group: led
50 | udev: # Updated
51 | sys_name: ayn:rgb:joystick_rings
52 | subsystem: leds
53 |
54 | # Optional configuration for the composite device
55 | options:
56 | # If true, InputPlumber will automatically try to manage the input device. If
57 | # this is false, InputPlumber will not try to manage the device unless an
58 | # external service enables management of the device. Defaults to 'false'
59 | auto_manage: true
60 |
61 | # The target input device(s) to emulate by default
62 | target_devices:
63 | - xbox-series
64 | - mouse
65 | - keyboard
66 |
67 | # The ID of a device event mapping in the 'event_maps' folder
68 | capability_map_id: ayn1
69 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-gpd_win3.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: GPD Win3
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: G1618-03
20 | sys_vendor: GPD
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: "Microsoft X-Box 360 pad"
28 | phys_path: usb-0000:00:14.0-7/input0
29 | handler: event*
30 | - group: keyboard
31 | evdev:
32 | name: " Mouse for Windows"
33 | phys_path: usb-0000:00:14.0-5/input1
34 | handler: event*
35 | - group: imu
36 | iio:
37 | name: i2c-BMI0160:00
38 |
39 | # Optional configuration for the composite device
40 | options:
41 | # If true, InputPlumber will automatically try to manage the input device. If
42 | # this is false, InputPlumber will not try to manage the device unless an
43 | # external service enables management of the device. Defaults to 'false'
44 | auto_manage: true
45 |
46 | # The target input device(s) to emulate by default
47 | target_devices:
48 | - xbox-elite
49 | - mouse
50 | - keyboard
51 |
52 | # The ID of a device event mapping in the 'event_maps' folder
53 | capability_map_id: gpd1
54 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-gpd_win4.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: GPD Win4
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: G1618-04
20 | sys_vendor: GPD
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: "Microsoft X-Box 360 pad"
28 | phys_path: usb-0000:73:00.3-4.1/input0
29 | handler: event*
30 | - group: keyboard
31 | evdev:
32 | name: " Mouse for Windows"
33 | handler: event*
34 | phys_path: usb-0000:73:00.3-4.2/input1
35 | - group: imu
36 | iio:
37 | name: i2c-BMI0160:00
38 | mount_matrix:
39 | # Tested on 6800U
40 | # TODO: Verify on other models
41 | x: [-1, 0, 0]
42 | y: [0, -1, 0]
43 | z: [0, 0, 1]
44 |
45 | # Optional configuration for the composite device
46 | options:
47 | # If true, InputPlumber will automatically try to manage the input device. If
48 | # this is false, InputPlumber will not try to manage the device unless an
49 | # external service enables management of the device. Defaults to 'false'
50 | auto_manage: true
51 |
52 | # The target input device(s) to emulate by default
53 | target_devices:
54 | - xbox-elite
55 | - mouse
56 | - keyboard
57 |
58 | # The ID of a device event mapping in the 'event_maps' folder
59 | capability_map_id: gpd3
60 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-gpd_winmini.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: GPD WinMini
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: G1617-01
20 | sys_vendor: GPD
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: "Microsoft X-Box 360 pad"
28 | phys_path: usb-0000:63:00.3-5/input0
29 | handler: event*
30 | - group: keyboard
31 | evdev:
32 | name: " Mouse for Windows"
33 | phys_path: usb-0000:63:00.3-3/input1
34 | handler: event*
35 | - group: imu
36 | iio:
37 | name: "{i2c-BMI0160:00,bmi260}"
38 | mount_matrix:
39 | x: [1, 0, 0]
40 | y: [0, 0, -1]
41 | z: [0, 1, 0]
42 |
43 | # Optional configuration for the composite device
44 | options:
45 | # If true, InputPlumber will automatically try to manage the input device. If
46 | # this is false, InputPlumber will not try to manage the device unless an
47 | # external service enables management of the device. Defaults to 'false'
48 | auto_manage: true
49 |
50 | # The target input device(s) to emulate by default
51 | target_devices:
52 | - xbox-elite
53 | - mouse
54 | - keyboard
55 |
56 | # The ID of a device event mapping in the 'event_maps' folder
57 | capability_map_id: gpd3
58 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-legion_go_2.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Lenovo Legion Go 2
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches match. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: "{83N0,83N1}"
20 | sys_vendor: LENOVO
21 | cpu_vendor: AuthenticAMD
22 |
23 | # One or more source devices to combine into a single virtual device. The events
24 | # from these devices will be watched and translated according to the key map.
25 | source_devices:
26 | ## XInput - Connected 0x61eb
27 | # Touchpad
28 | - group: mouse # Gamepad Mode
29 | hidraw:
30 | vendor_id: 0x17ef
31 | product_id: 0x61eb
32 | interface_num: 1
33 | # Gamepad
34 | - group: gamepad
35 | hidraw:
36 | vendor_id: 0x17ef
37 | product_id: 0x61eb
38 | interface_num: 2
39 | - group: gamepad
40 | unique: true
41 | evdev:
42 | name: "{Lenovo Legion Controller for Windows,Generic X-Box pad}"
43 | vendor_id: "17ef"
44 | product_id: "61eb"
45 | handler: event*
46 | # Block all evdev devices; mouse, touchpad, keyboard
47 | - group: gamepad
48 | blocked: true
49 | unique: false
50 | evdev:
51 | name: " Legion Controller for Windows *"
52 | vendor_id: "17ef"
53 | product_id: "61eb"
54 | handler: event*
55 |
56 | # Touchscreen
57 | #- group: touchscreen
58 | # udev:
59 | # properties:
60 | # - name: ID_INPUT_TOUCHSCREEN
61 | # value: "1"
62 | # sys_name: "event*"
63 | # subsystem: input
64 | # config:
65 | # touchscreen:
66 | # orientation: "left"
67 | # Optional configuration for the composite device
68 |
69 | options:
70 | # If true, InputPlumber will automatically try to manage the input device. If
71 | # this is false, InputPlumber will not try to manage the device unless an
72 | # external service enables management of the device. Defaults to 'false'
73 | auto_manage: true
74 |
75 | # The target input device(s) to emulate by default
76 | target_devices:
77 | - xbox-elite
78 | - mouse
79 | #- keyboard
80 | #- touchpad
81 | #- touchscreen
82 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-msi_claw7_a2vm.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: MSI Claw 7 AI+ A2VM
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches match. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: "Claw 7 AI+ A2VM"
20 | sys_vendor: "Micro-Star International Co., Ltd."
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | # Extra Buttons
26 | - group: keyboard
27 | evdev:
28 | name: AT Translated Set 2 keyboard
29 | phys_path: isa0060/serio0/input0
30 |
31 | # Gamepad
32 | - group: gamepad
33 | evdev:
34 | vendor_id: "0db0"
35 | product_id: "1901"
36 | phys_path: "usb-0000:00:14.0-2/input0"
37 | - group: gamepad
38 | passthrough: true
39 | hidraw:
40 | vendor_id: 0x0db0
41 | product_id: 0x1901
42 | interface_num: 2
43 |
44 | # IMU
45 |
46 | # Optional configuration for the composite device
47 | options:
48 | # If true, InputPlumber will automatically try to manage the input device. If
49 | # this is false, InputPlumber will not try to manage the device unless an
50 | # external service enables management of the device. Defaults to 'false'
51 | auto_manage: true
52 |
53 | # The target input device(s) to emulate by default
54 | target_devices:
55 | - xbox-elite
56 | - mouse
57 | - keyboard
58 |
59 | # The ID of a device event mapping in the 'event_maps' folder
60 | capability_map_id: claw1
61 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-msi_claw8_a2vm.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: MSI Claw 8 AI+ A2VM
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches match. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: "Claw 8 AI+ A2VM"
20 | sys_vendor: "Micro-Star International Co., Ltd."
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | # Extra Buttons
26 | - group: keyboard
27 | evdev:
28 | name: AT Translated Set 2 keyboard
29 | phys_path: isa0060/serio0/input0
30 |
31 | # Gamepad
32 | - group: gamepad
33 | evdev:
34 | vendor_id: "0db0"
35 | product_id: "1901"
36 | phys_path: "usb-0000:00:14.0-2/input0"
37 | - group: gamepad
38 | passthrough: true
39 | hidraw:
40 | vendor_id: 0x0db0
41 | product_id: 0x1901
42 | interface_num: 2
43 |
44 | # IMU
45 |
46 | # Optional configuration for the composite device
47 | options:
48 | # If true, InputPlumber will automatically try to manage the input device. If
49 | # this is false, InputPlumber will not try to manage the device unless an
50 | # external service enables management of the device. Defaults to 'false'
51 | auto_manage: true
52 |
53 | # The target input device(s) to emulate by default
54 | target_devices:
55 | - xbox-elite
56 | - mouse
57 | - keyboard
58 |
59 | # The ID of a device event mapping in the 'event_maps' folder
60 | capability_map_id: claw1
61 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-onexplayer_2.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: ONEXPLAYER 2
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: ONEXPLAYER 2 ARP23
20 | sys_vendor: ONE-NETBOOK
21 | - dmi_data:
22 | product_name: ONEXPLAYER 2 PRO ARP23
23 | sys_vendor: ONE-NETBOOK
24 | - dmi_data:
25 | product_name: ONEXPLAYER 2 PRO ARP23 EVA-01
26 | sys_vendor: ONE-NETBOOK
27 |
28 | # One or more source devices to combine into a single virtual device. The events
29 | # from these devices will be watched and translated according to the key map.
30 | source_devices:
31 | - group: gamepad
32 | evdev:
33 | name: Microsoft X-Box 360 pad
34 | phys_path: usb-0000:74:00.3-4/input0
35 | handler: event*
36 | - group: gamepad
37 | evdev:
38 | name: Microsoft X-Box 360 pad
39 | phys_path: usb-0000:64:00.3-4/input0
40 | handler: event*
41 | - group: keyboard
42 | evdev:
43 | name: AT Translated Set 2 keyboard
44 | phys_path: isa0060/serio0/input0
45 | handler: event*
46 | - group: imu
47 | iio:
48 | name: i2c-BMI0160:00
49 |
50 | # Optional configuration for the composite device
51 | options:
52 | # If true, InputPlumber will automatically try to manage the input device. If
53 | # this is false, InputPlumber will not try to manage the device unless an
54 | # external service enables management of the device. Defaults to 'false'
55 | auto_manage: true
56 |
57 | # The target input device(s) to emulate by default
58 | target_devices:
59 | - xbox-series
60 | - mouse
61 | - keyboard
62 |
63 | # The ID of a device event mapping in the 'event_maps' folder
64 | capability_map_id: oxp4
65 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-onexplayer_amd.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: OneXPlayer AMD
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: ONE XPLAYER
20 | sys_vendor: ONE-NETBOOK
21 | cpu_vendor: AuthenticAMD
22 | - dmi_data:
23 | product_name: ONE XPLAYER
24 | sys_vendor: ONE-NETBOOK
25 | cpu_vendor: AuthenticAMD Advanced Micro Devices, Inc.
26 | - dmi_data:
27 | product_name: ONEXPLAYER
28 | sys_vendor: ONE-NETBOOK
29 | cpu_vendor: AuthenticAMD
30 | - dmi_data:
31 | product_name: ONEXPLAYER
32 | sys_vendor: ONE-NETBOOK
33 | cpu_vendor: AuthenticAMD Advanced Micro Devices, Inc.
34 | - dmi_data:
35 | product_name: ONE XPLAYER
36 | sys_vendor: ONE-NETBOOK TECHNOLOGY CO., LTD.
37 | cpu_vendor: AuthenticAMD
38 |
39 | # One or more source devices to combine into a single virtual device. The events
40 | # from these devices will be watched and translated according to the key map.
41 | source_devices:
42 | - group: gamepad
43 | evdev:
44 | name: Microsoft X-Box 360 pad
45 | phys_path: usb-0000:03:00.3-4/input0
46 | handler: event*
47 | - group: gamepad
48 | evdev:
49 | name: Microsoft X-Box 360 pad
50 | phys_path: usb-0000:03:00.3-4/input1
51 | handler: event*
52 | - group: keyboard
53 | evdev:
54 | name: AT Translated Set 2 keyboard
55 | phys_path: isa0060/serio0/input0
56 | handler: event*
57 | - group: imu
58 | iio:
59 | name: i2c-BMI0160:00
60 |
61 | # Optional configuration for the composite device
62 | options:
63 | # If true, InputPlumber will automatically try to manage the input device. If
64 | # this is false, InputPlumber will not try to manage the device unless an
65 | # external service enables management of the device. Defaults to 'false'
66 | auto_manage: true
67 |
68 | # The target input device(s) to emulate by default
69 | target_devices:
70 | - xbox-series
71 | - mouse
72 | - keyboard
73 |
74 | # The ID of a device event mapping in the 'capability_maps' folder
75 | capability_map_id: oxp2
76 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-onexplayer_intel.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: OneXPlayer Intel
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: ONEXPLAYER
20 | sys_vendor: ONE-NETBOOK
21 | cpu_vendor: GenuineIntel
22 | - dmi_data:
23 | product_name: ONE XPLAYER
24 | sys_vendor: ONE-NETBOOK TECHNOLOGY CO., LTD.
25 | cpu_vendor: GenuineIntel
26 |
27 | # One or more source devices to combine into a single virtual device. The events
28 | # from these devices will be watched and translated according to the key map.
29 | source_devices:
30 | - group: gamepad
31 | evdev:
32 | name: OneXPlayer Gamepad
33 | phys_path: usb-0000:00:14.0-9/input0
34 | handler: event*
35 | - group: keyboard
36 | evdev:
37 | name: AT Translated Set 2 keyboard
38 | phys_path: isa0060/serio0/input0
39 | handler: event*
40 |
41 | # Optional configuration for the composite device
42 | options:
43 | # If true, InputPlumber will automatically try to manage the input device. If
44 | # this is false, InputPlumber will not try to manage the device unless an
45 | # external service enables management of the device. Defaults to 'false'
46 | auto_manage: true
47 |
48 | # The target input device(s) to emulate by default
49 | target_devices:
50 | - xbox-series
51 | - mouse
52 | - keyboard
53 |
54 | # The ID of a device event mapping in the 'capability_maps' folder
55 | capability_map_id: oxp1
56 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-onexplayer_mini_a07.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: OneXPlayer mini A07
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: ONEXPLAYER mini A07
20 | sys_vendor: ONE-NETBOOK
21 | cpu_vendor: AuthenticAMD
22 |
23 | # One or more source devices to combine into a single virtual device. The events
24 | # from these devices will be watched and translated according to the key map.
25 | source_devices:
26 | - group: gamepad
27 | evdev:
28 | name: Microsoft X-Box 360 pad
29 | phys_path: usb-0000:03:00.3-4/input0
30 | handler: event*
31 | - group: keyboard
32 | evdev:
33 | name: AT Translated Set 2 keyboard
34 | phys_path: isa0060/serio0/input0
35 | handler: event*
36 | - group: imu
37 | iio:
38 | name: i2c-BMI0160:00
39 |
40 | # Optional configuration for the composite device
41 | options:
42 | # If true, InputPlumber will automatically try to manage the input device. If
43 | # this is false, InputPlumber will not try to manage the device unless an
44 | # external service enables management of the device. Defaults to 'false'
45 | auto_manage: true
46 |
47 | # The target input device(s) to emulate by default
48 | target_devices:
49 | - xbox-series
50 | - mouse
51 | - keyboard
52 |
53 | # The ID of a device event mapping in the 'capability_maps' folder
54 | capability_map_id: oxp3
55 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-onexplayer_mini_pro.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: ONEXPLAYER Mini Pro
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: ONEXPLAYER Mini Pro
20 | sys_vendor: ONE-NETBOOK
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: Microsoft X-Box 360 pad
28 | phys_path: usb-0000:e3:00.3-4/input0
29 | handler: event*
30 | - group: keyboard
31 | evdev:
32 | name: AT Translated Set 2 keyboard
33 | phys_path: isa0060/serio0/input0
34 | handler: event*
35 | - group: imu
36 | iio:
37 | name: i2c-BMI0160:00
38 |
39 | # Optional configuration for the composite device
40 | options:
41 | # If true, InputPlumber will automatically try to manage the input device. If
42 | # this is false, InputPlumber will not try to manage the device unless an
43 | # external service enables management of the device. Defaults to 'false'
44 | auto_manage: true
45 |
46 | # The target input device(s) to emulate by default
47 | target_devices:
48 | - xbox-series
49 | - mouse
50 | - keyboard
51 |
52 | # The ID of a device event mapping in the 'event_maps' folder
53 | capability_map_id: oxp3
54 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-onexplayer_onexfly.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: ONEXPLAYER ONEXFLY
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: ONEXPLAYER F1
20 | sys_vendor: ONE-NETBOOK
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: Microsoft X-Box 360 pad
28 | phys_path: usb-0000:c4:00.3-4/input0
29 | handler: event*
30 | - group: keyboard
31 | evdev:
32 | name: AT Translated Set 2 keyboard
33 | phys_path: isa0060/serio0/input0
34 | handler: event*
35 | - group: imu
36 | iio:
37 | name: i2c-BMI0160:00
38 |
39 | # Optional configuration for the composite device
40 | options:
41 | # If true, InputPlumber will automatically try to manage the input device. If
42 | # this is false, InputPlumber will not try to manage the device unless an
43 | # external service enables management of the device. Defaults to 'false'
44 | auto_manage: true
45 |
46 | # The target input device(s) to emulate by default
47 | target_devices:
48 | - xbox-series
49 | - mouse
50 | - keyboard
51 |
52 | # The ID of a device event mapping in the 'event_maps' folder
53 | capability_map_id: oxp3
54 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-onexplayer_onexfly_pro.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: ONEXPLAYER ONEXFLY Pro
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: ONEXPLAYER F1Pro
20 | sys_vendor: ONE-NETBOOK
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad
26 | evdev:
27 | name: Microsoft X-Box 360 pad
28 | phys_path: usb-0000:c7:00.0-4/input0
29 | handler: event*
30 | - group: keyboard
31 | evdev:
32 | name: AT Translated Set 2 keyboard
33 | phys_path: isa0060/serio0/input0
34 | handler: event*
35 | - group: imu
36 | iio:
37 | name: i2c-BMI0160:00
38 |
39 | # Optional configuration for the composite device
40 | options:
41 | # If true, InputPlumber will automatically try to manage the input device. If
42 | # this is false, InputPlumber will not try to manage the device unless an
43 | # external service enables management of the device. Defaults to 'false'
44 | auto_manage: true
45 |
46 | # The target input device(s) to emulate by default
47 | target_devices:
48 | - xbox-series
49 | - mouse
50 | - keyboard
51 |
52 | # The ID of a device event mapping in the 'event_maps' folder
53 | capability_map_id: oxp3
54 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-steam_deck.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Steam Deck
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches match. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | product_name: Galileo
20 | sys_vendor: Valve
21 | cpu_vendor: AuthenticAMD
22 | - dmi_data:
23 | product_name: Jupiter
24 | sys_vendor: Valve
25 | cpu_vendor: AuthenticAMD
26 |
27 | # One or more source devices to combine into a single virtual device. The events
28 | # from these devices will be watched and translated according to the key map.
29 | source_devices:
30 | # Gamepad
31 | - group: gamepad
32 | hidraw:
33 | vendor_id: 0x28de
34 | product_id: 0x1205
35 | interface_num: 2
36 | # Touchscreen
37 | - group: touchscreen
38 | unique: false
39 | udev:
40 | properties:
41 | - name: ID_INPUT_TOUCHSCREEN
42 | value: "1"
43 | sys_name: "event*"
44 | subsystem: input
45 | config:
46 | touchscreen:
47 | orientation: "right"
48 | # Keyboard
49 | - group: keyboard
50 | evdev:
51 | name: AT Translated Set 2 keyboard
52 | phys_path: isa0060/serio0/input0
53 | handler: event*
54 |
55 | # Optional configuration for the composite device
56 | options:
57 | # If true, InputPlumber will automatically try to manage the input device. If
58 | # this is false, InputPlumber will not try to manage the device unless an
59 | # external service enables management of the device. Defaults to 'false'
60 | auto_manage: false
61 |
62 | # The target input device(s) to emulate by default
63 | target_devices:
64 | - xbox-elite
65 | - mouse
66 | - keyboard
67 | - touchscreen
68 | - touchpad
69 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/50-zotac-zone.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Zotac Zone
10 |
11 | # Only allow a single source device per composite device of this type.
12 | single_source: false
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches:
18 | - dmi_data:
19 | board_name: "{G0A1W,G1A1W}"
20 | sys_vendor: ZOTAC
21 |
22 | # One or more source devices to combine into a single virtual device. The events
23 | # from these devices will be watched and translated according to the key map.
24 | source_devices:
25 | - group: gamepad # Used for setting attributes on load
26 | hidraw:
27 | vendor_id: 0x1ee9
28 | product_id: 0x1590
29 | interface_num: 3
30 | - group: gamepad
31 | evdev:
32 | name: ZOTAC Gaming Zone Gamepad
33 | vendor_id: "1ee9"
34 | product_id: "1590"
35 | handler: event*
36 | capability_map_id: zone1
37 | - group: keyboard
38 | evdev:
39 | name: ZOTAC Gaming Zone Keyboard
40 | vendor_id: "1ee9"
41 | product_id: "1590"
42 | handler: event*
43 | capability_map_id: zone1
44 | - group: mouse
45 | evdev:
46 | name: ZOTAC Gaming Zone Mouse
47 | vendor_id: "1ee9"
48 | product_id: "1590"
49 | handler: event*
50 | - group: mouse
51 | evdev:
52 | name: ZOTAC Gaming Zone Dials
53 | vendor_id: "1ee9"
54 | product_id: "1590"
55 | handler: event*
56 | capability_map_id: zone1
57 | - group: imu
58 | iio:
59 | name: i2c-BMI0160:00
60 |
61 | #RGB
62 | - group: led
63 | udev:
64 | sys_name: zotac:rgb:spectra_zone_0
65 | subsystem: leds
66 | - group: led
67 | udev:
68 | sys_name: zotac:rgb:spectra_zone_1
69 | subsystem: leds
70 |
71 | # Optional configuration for the composite device
72 | options:
73 | # If true, InputPlumber will automatically try to manage the input device. If
74 | # this is false, InputPlumber will not try to manage the device unless an
75 | # external service enables management of the device. Defaults to 'false'
76 | auto_manage: true
77 |
78 | # The target input device(s) to emulate by default
79 | target_devices:
80 | - xbox-elite
81 | - mouse
82 | - keyboard
83 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/60-8bit_do_pro_2.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: 8BitDo 8BitDo Pro 2
10 |
11 | # Only use this profile if *any* of the given matches matches. If this list is
12 | # empty, then the source devices will *always* be checked.
13 | # /sys/class/dmi/id/product_name
14 | matches: []
15 |
16 | # Maximum number of source devices per CompositeDevice.
17 | maximum_sources: 1
18 |
19 | # One or more source devices to combine into a single virtual device. The events
20 | # from these devices will be watched and translated according to the key map.
21 | source_devices:
22 | - group: gamepad
23 | udev:
24 | attributes:
25 | - name: id/vendor
26 | value: "2dc8"
27 | - name: id/product
28 | value: "6006"
29 | sys_name: "event*"
30 | subsystem: input
31 | capability_map_id: dinput_generic
32 |
33 | # The target input device(s) to emulate by default
34 | target_devices:
35 | - xbox-elite
36 | - mouse
37 | - keyboard
38 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/60-LogitechDualAction.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Logitech Dual ACtion
10 | # Only use this profile if *any* of the given matches matches. If this list is
11 | # empty, then the source devices will *always* be checked.
12 | # /sys/class/dmi/id/product_name
13 | matches: []
14 |
15 | # Maximum number of source devices per CompositeDevice.
16 | maximum_sources: 1
17 |
18 | # One or more source devices to combine into a single virtual device. The events
19 | # from these devices will be watched and translated according to the key map.
20 | source_devices:
21 | - group: gamepad
22 | udev:
23 | attributes:
24 | - name: id/vendor
25 | value: "046d"
26 | - name: id/product
27 | value: "c216"
28 | sys_name: "event*"
29 | subsystem: input
30 | capability_map_id: logitech_dualaction
31 |
32 | # The target input device(s) to emulate by default
33 | target_devices:
34 | - xbox-elite
35 | - mouse
36 | - keyboard
37 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/60-flydigi_vader_4_pro.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: flydigi-vader-4-pro
10 |
11 | # Only use this profile if *any* of the given matches matches. If this list is
12 | # empty,then the source devices will *always* be checked.
13 | # /sys/class/dmi/id/product_name
14 | matches: []
15 |
16 | # Maximum number of source devices per CompositeDevice.
17 | maximum_sources: 5
18 |
19 | # One or more source devices to combine into a single virtual device. The events
20 | # from these devices will be watched and translated according to the key map.
21 | source_devices:
22 | - group: gamepad
23 | udev:
24 | attributes:
25 | - name: idVendor
26 | value: "04b4"
27 | - name: idProduct
28 | value: "2412"
29 | - name: bInterfaceNumber
30 | value: "02"
31 | subsystem: hidraw
32 | - group: gamepad
33 | unique: false
34 | blocked: true
35 | udev:
36 | attributes:
37 | - name: idVendor
38 | value: "04b4"
39 | - name: idProduct
40 | value: "2412"
41 | sys_name: "event*"
42 | subsystem: input
43 |
44 | # The target input device(s) to emulate by default
45 | target_devices:
46 | - deck
47 | - touchpad
48 |
49 | capability_map_id: flydigi-vader-4-pro
50 |
51 | options:
52 | auto_manage: true
53 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/60-horipad_steam.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Horipad Steam
10 |
11 | # Only use this profile if *any* of the given matches matches. If this list is
12 | # empty,then the source devices will *always* be checked.
13 | # /sys/class/dmi/id/product_name
14 | matches: []
15 |
16 | # Only allow a CompositeDevice to manage at most the given number of
17 | # source devices. When this limit is reached, a new CompositeDevice will be
18 | # created for any new matching devices.
19 | maximum_sources: 2
20 |
21 | # One or more source devices to combine into a single virtual device. The events
22 | # from these devices will be watched and translated according to the key map.
23 | source_devices:
24 | - group: gamepad
25 | blocked: true
26 | udev:
27 | attributes:
28 | - name: id/vendor
29 | value: "0f0d"
30 | - name: id/product
31 | value: "{0196,01ab}"
32 | sys_name: "event*"
33 | subsystem: input
34 | - group: gamepad
35 | hidraw:
36 | vendor_id: 0x0f0d
37 | product_id: 0x0196
38 | - group: gamepad
39 | hidraw:
40 | vendor_id: 0x0f0d
41 | product_id: 0x01ab
42 |
43 | # The target input device(s) to emulate by default
44 | target_devices:
45 | - hori-steam
46 | - mouse
47 | - keyboard
48 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/60-ps4_gamepad.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Sony Interactive Entertainment Wireless Controller
10 |
11 | # Maximum number of source devices per CompositeDevice.
12 | maximum_sources: 4
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches: []
18 |
19 | source_devices:
20 | - group: gamepad
21 | evdev:
22 | name: "*Wireless Controller"
23 | vendor_id: 054c
24 | product_id: 09cc
25 | handler: event*
26 | capability_map_id: swap_west_north
27 |
28 | - group: gamepad
29 | evdev:
30 | name: "*Wireless Controller Touchpad"
31 | vendor_id: 054c
32 | product_id: 09cc
33 | handler: event*
34 | capability_map_id: imu_generic
35 |
36 | - group: gamepad
37 | evdev:
38 | name: "*Wireless Controller Motion Sensors"
39 | vendor_id: 054c
40 | product_id: 09cc
41 | handler: event*
42 |
43 | # Block the hidraw device to prevent SDL usage of the device
44 | - group: gamepad
45 | blocked: true
46 | hidraw:
47 | vendor_id: 0x054c
48 | product_id: 0x09cc
49 |
50 | # The target input device(s) to emulate by default
51 | target_devices:
52 | - ds5
53 | - mouse
54 | - keyboard
55 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/60-ps5_ds-edge_gamepad.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Sony Interactive Entertainment DualSense Edge Wireless Controller
10 |
11 | # Maximum number of source devices per CompositeDevice.
12 | maximum_sources: 4
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches: []
18 |
19 | source_devices:
20 | - group: gamepad
21 | hidraw:
22 | vendor_id: 0x054c
23 | product_id: 0x0df2
24 |
25 | # Block the evdev implementations
26 | - group: gamepad
27 | blocked: true
28 | evdev:
29 | name: "{Sony Interactive Entertainment DualSense Edge Wireless Controller,DualSense Edge Wireless Controller}"
30 | vendor_id: 054c
31 | product_id: 0df2
32 | handler: event*
33 | - group: gamepad
34 | blocked: true
35 | evdev:
36 | name: "{Sony Interactive Entertainment DualSense Edge Wireless Controller Touchpad,DualSense Edge Wireless Controller Touchpad}"
37 | vendor_id: 054c
38 | product_id: 0df2
39 | handler: event*
40 | - group: gamepad
41 | blocked: true
42 | evdev:
43 | name: "{Sony Interactive Entertainment DualSense Edge Wireless Controller Motion Sensors,DualSense Edge Wireless Controller Motion Sensors}"
44 | vendor_id: 054c
45 | product_id: 0df2
46 | handler: event*
47 |
48 | # The target input device(s) to emulate by default
49 | target_devices:
50 | - ds5-edge
51 | - mouse
52 | - keyboard
53 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/60-ps5_ds_gamepad.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Sony Interactive Entertainment DualSense Wireless Controller
10 |
11 | # Maximum number of source devices per CompositeDevice.
12 | maximum_sources: 4
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches: []
18 |
19 | source_devices:
20 | - group: gamepad
21 | hidraw:
22 | vendor_id: 0x054c
23 | product_id: 0x0ce6
24 |
25 | # Block the evdev implementations
26 | - group: gamepad
27 | blocked: true
28 | evdev:
29 | name: "*DualSense Wireless Controller"
30 | vendor_id: 054c
31 | product_id: 0ce6
32 | handler: event*
33 | - group: gamepad
34 | blocked: true
35 | evdev:
36 | name: "*DualSense Wireless Controller Touchpad"
37 | vendor_id: 054c
38 | product_id: 0ce6
39 | handler: event*
40 | - group: gamepad
41 | blocked: true
42 | evdev:
43 | name: "*DualSense Wireless Controller Motion Sensors"
44 | vendor_id: 054c
45 | product_id: 0ce6
46 | handler: event*
47 |
48 | # The target input device(s) to emulate by default
49 | target_devices:
50 | - ds5
51 | - mouse
52 | - keyboard
53 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/60-switch_pro.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=../schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Nintendo Co., Ltd. Pro Controller
10 |
11 | # Maximum number of source devices per CompositeDevice.
12 | maximum_sources: 1
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches: []
18 |
19 | # One or more source devices to combine into a single virtual device. The events
20 | # from these devices will be watched and translated according to the key map.
21 | source_devices:
22 | - group: gamepad
23 | evdev:
24 | name: Nintendo Co., Ltd. Pro Controller
25 | handler: event*
26 | #- group: imu
27 | # evdev:
28 | # name: Nintendo Co., Ltd. Pro Controller (IMU)
29 |
30 | # The target input device(s) to emulate by default
31 | target_devices:
32 | - gamepad #TODO: Nintendo controller target
33 | - mouse
34 | - keyboard
35 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/60-xbox_one_bt_gamepad.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Microsoft X-Box One pad
10 |
11 | # Only use this profile if *any* of the given matches matches. If this list is
12 | # empty,then the source devices will *always* be checked.
13 | # /sys/class/dmi/id/product_name
14 | matches: []
15 |
16 | # Only allow a CompositeDevice to manage at most the given number of
17 | # source devices. When this limit is reached, a new CompositeDevice will be
18 | # created for any new matching devices.
19 | maximum_sources: 2
20 |
21 | # One or more source devices to combine into a single virtual device. The events
22 | # from these devices will be watched and translated according to the key map.
23 | source_devices:
24 | - group: gamepad
25 | blocked: true
26 | udev:
27 | attributes:
28 | - name: name
29 | value: Xbox Wireless Controller
30 | properties:
31 | - name: ID_BUS
32 | value: bluetooth
33 | driver: microsoft
34 | sys_name: "event*"
35 | subsystem: input
36 | - group: gamepad
37 | udev:
38 | # NOTE: This might also capture other non-xbox microsoft devices :(
39 | driver: microsoft
40 | subsystem: hidraw
41 |
42 | # The target input device(s) to emulate by default
43 | target_devices:
44 | - xbox-series
45 | - mouse
46 | - keyboard
47 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/60-xbox_one_elite_gamepad.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Microsoft X-Box One Elite pad
10 |
11 | # Only use this profile if *any* of the given matches matches. If this list is
12 | # empty,then the source devices will *always* be checked.
13 | # /sys/class/dmi/id/product_name
14 | matches: []
15 |
16 | # Maximum number of source devices per CompositeDevice.
17 | maximum_sources: 1
18 |
19 | # One or more source devices to combine into a single virtual device. The events
20 | # from these devices will be watched and translated according to the key map.
21 | source_devices:
22 | - group: gamepad
23 | unique: true
24 | evdev:
25 | vendor_id: "045e"
26 | product_id: "{02e3,0b00}"
27 | handler: event*
28 |
29 | # The target input device(s) to emulate by default
30 | target_devices:
31 | - xbox-elite
32 | - mouse
33 | - keyboard
34 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/65-generic_gamepad.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Generic Gamepad
10 |
11 | # Only use this profile if *any* of the given matches matches. If this list is
12 | # empty, then the source devices will *always* be checked.
13 | # /sys/class/dmi/id/product_name
14 | matches: []
15 |
16 | # Maximum number of source devices per CompositeDevice.
17 | maximum_sources: 1
18 |
19 | # One or more source devices to combine into a single virtual device. The events
20 | # from these devices will be watched and translated according to the key map.
21 | source_devices:
22 | - group: gamepad
23 | udev:
24 | properties:
25 | - name: ID_INPUT_JOYSTICK
26 | value: "1"
27 | sys_name: "event*"
28 | subsystem: input
29 |
30 | # The target input device(s) to emulate by default
31 | target_devices:
32 | - xb360
33 | - mouse
34 | - keyboard
35 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/devices/69-ignore_generic.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: CompositeDevice
7 |
8 | # Name of the composite device mapping
9 | name: Ignore Gamepads
10 |
11 | # Maximum number of source devices per CompositeDevice.
12 | maximum_sources: 1
13 |
14 | # Only use this profile if *any* of the given matches matches. If this list is
15 | # empty, then the source devices will *always* be checked.
16 | # /sys/class/dmi/id/product_name
17 | matches: []
18 |
19 | # One or more source devices to combine into a single virtual device. The events
20 | # from these devices will be watched and translated according to the key map.
21 | source_devices:
22 | - group: gamepad
23 | ignore: true
24 | evdev:
25 | handler: js*
26 | - group: gamepad
27 | ignore: true
28 | evdev:
29 | handler: event*
30 | - group: mouse
31 | ignore: true
32 | evdev:
33 | handler: mouse*
34 | - group: mouse
35 | ignore: true
36 | evdev:
37 | handler: mice*
38 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/profiles/debug.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/device_profile_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: DeviceProfile
7 |
8 | # Name of the device profile
9 | name: Debug
10 |
11 | # Profile mappings
12 | mapping: []
13 |
--------------------------------------------------------------------------------
/rootfs/usr/share/inputplumber/profiles/default.yaml:
--------------------------------------------------------------------------------
1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/device_profile_v1.json
2 | # Schema version number
3 | version: 1
4 |
5 | # The type of configuration schema
6 | kind: DeviceProfile
7 |
8 | # Name of the device profile
9 | name: Default
10 |
11 | # Target input device(s) to emulate. If unset, the target devices from the device profile will be used.
12 | #target_devices:
13 | # - gamepad
14 | # - mouse
15 | # - keyboard
16 |
17 | # Profile mappings
18 | mapping:
19 | - name: LeftTop
20 | source_event:
21 | gamepad:
22 | button: LeftTop
23 | target_events:
24 | - gamepad:
25 | button: LeftPaddle1
26 | - name: RightTop
27 | source_event:
28 | gamepad:
29 | button: RightTop
30 | target_events:
31 | - gamepad:
32 | button: RightPaddle1
33 | - name: Keyboard
34 | source_event:
35 | gamepad:
36 | button: Keyboard
37 | target_events:
38 | - gamepad:
39 | button: Guide
40 | - gamepad:
41 | button: North
42 | - name: QuickAccess2
43 | source_event:
44 | gamepad:
45 | button: QuickAccess2
46 | target_events:
47 | - gamepad:
48 | button: Screenshot
49 | - name: Left Dial Counter-clockwise
50 | source_event:
51 | gamepad:
52 | dial:
53 | name: LeftStickDial
54 | direction: counter-clockwise
55 | target_events:
56 | - keyboard: KeyVolumeDown
57 | - name: Left Dial Clockwise
58 | source_event:
59 | gamepad:
60 | dial:
61 | name: LeftStickDial
62 | direction: clockwise
63 | target_events:
64 | - keyboard: KeyVolumeUp
65 | - name: Right Dial Counter-clockwise
66 | source_event:
67 | gamepad:
68 | dial:
69 | name: RightStickDial
70 | direction: counter-clockwise
71 | target_events:
72 | - keyboard: KeyBrightnessDown
73 | - name: Right Dial Clockwise
74 | source_event:
75 | gamepad:
76 | dial:
77 | name: RightStickDial
78 | direction: clockwise
79 | target_events:
80 | - keyboard: KeyBrightnessUp
81 |
--------------------------------------------------------------------------------
/src/bluetooth/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod device1;
2 |
--------------------------------------------------------------------------------
/src/cli/source.rs:
--------------------------------------------------------------------------------
1 | use std::error::Error;
2 |
3 | use clap::Subcommand;
4 | use tabled::settings::{Panel, Style};
5 | use tabled::{Table, Tabled};
6 | use zbus::Connection;
7 |
8 | use crate::cli::get_managed_objects;
9 | use crate::dbus::interface::source::udev::SourceUdevDeviceInterfaceProxy;
10 |
11 | #[derive(Subcommand, Debug, Clone)]
12 | pub enum SourcesCommand {
13 | /// List all discovered source devices
14 | List,
15 | }
16 |
17 | #[derive(Tabled)]
18 | struct SourceDeviceRow {
19 | path: String,
20 | name: String,
21 | subsystem: String,
22 | }
23 |
24 | pub async fn handle_sources(conn: Connection, cmd: SourcesCommand) -> Result<(), Box> {
25 | match cmd {
26 | SourcesCommand::List => {
27 | let objects = get_managed_objects(conn.clone()).await?;
28 | let mut paths: Vec = objects
29 | .into_iter()
30 | .filter(|obj| obj.contains("/devices/source/"))
31 | .collect();
32 | paths.sort();
33 | let count = paths.len();
34 |
35 | // Query information about each device
36 | let mut source_devices = Vec::with_capacity(paths.len());
37 | for path in paths {
38 | let device = SourceUdevDeviceInterfaceProxy::builder(&conn)
39 | .path(path.clone())
40 | .unwrap()
41 | .build()
42 | .await;
43 | let Some(device) = device.ok() else {
44 | continue;
45 | };
46 |
47 | let name = device.name().await.unwrap_or_default();
48 | let subsystem = device.subsystem().await.unwrap_or_default();
49 | let path = device.device_path().await.unwrap_or_default();
50 |
51 | let row = SourceDeviceRow {
52 | path,
53 | name,
54 | subsystem,
55 | };
56 |
57 | source_devices.push(row);
58 | }
59 |
60 | let mut table = Table::new(source_devices);
61 | table
62 | .with(Style::modern_rounded())
63 | .with(Panel::header("Source Devices"));
64 | println!("{table}");
65 | println!("Found {count} source device(s)");
66 | }
67 | }
68 |
69 | Ok(())
70 | }
71 |
--------------------------------------------------------------------------------
/src/cli/ui/menu.rs:
--------------------------------------------------------------------------------
1 | pub mod device_test_menu;
2 |
3 | use device_test_menu::DeviceTestMenu;
4 | use ratatui::{
5 | crossterm::event::{KeyCode, KeyEvent},
6 | prelude::{Buffer, Rect},
7 | widgets::Widget,
8 | };
9 |
10 | use super::InterfaceCommand;
11 |
12 | /// A [MenuWidget] is a [Widget] that can also handle key input
13 | pub trait MenuWidget {
14 | fn update(&mut self) -> Vec {
15 | vec![]
16 | }
17 | fn handle_key_event(&mut self, key_event: KeyEvent) -> Vec {
18 | match key_event.code {
19 | KeyCode::Char('q') => vec![InterfaceCommand::Quit],
20 | _ => vec![],
21 | }
22 | }
23 | }
24 |
25 | /// Enumeration of all available menus
26 | #[derive(Debug)]
27 | pub enum Menu {
28 | DeviceTest(DeviceTestMenu),
29 | }
30 |
31 | impl Widget for &Menu {
32 | fn render(self, area: Rect, buf: &mut Buffer)
33 | where
34 | Self: Sized,
35 | {
36 | match self {
37 | Menu::DeviceTest(device_test_menu) => device_test_menu.render(area, buf),
38 | }
39 | }
40 | }
41 |
42 | impl MenuWidget for Menu {
43 | fn update(&mut self) -> Vec {
44 | match self {
45 | Menu::DeviceTest(device_test_menu) => device_test_menu.update(),
46 | }
47 | }
48 |
49 | fn handle_key_event(&mut self, key_event: KeyEvent) -> Vec {
50 | match self {
51 | Menu::DeviceTest(device_test_menu) => device_test_menu.handle_key_event(key_event),
52 | }
53 | }
54 | }
55 |
56 | impl From for Menu {
57 | fn from(value: DeviceTestMenu) -> Self {
58 | Self::DeviceTest(value)
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/cli/ui/widgets.rs:
--------------------------------------------------------------------------------
1 | pub mod axis_gauge;
2 | pub mod button_gauge;
3 | pub mod gyro_gauge;
4 | pub mod touch_gauge;
5 | pub mod trigger_gauge;
6 |
--------------------------------------------------------------------------------
/src/cli/ui/widgets/axis_gauge.rs:
--------------------------------------------------------------------------------
1 | use ratatui::{
2 | prelude::*,
3 | widgets::{
4 | canvas::{Canvas, Circle},
5 | Block, Widget,
6 | },
7 | };
8 |
9 | use crate::drivers::unified_gamepad::capability::InputCapability;
10 |
11 | #[derive(Debug, Default)]
12 | pub struct AxisGauge {
13 | capability: InputCapability,
14 | text: String,
15 | x: f64,
16 | y: f64,
17 | }
18 |
19 | impl AxisGauge {
20 | pub fn new(capability: InputCapability, text: &str) -> Self {
21 | Self {
22 | text: text.to_string(),
23 | capability,
24 | x: 0.0,
25 | y: 0.0,
26 | }
27 | }
28 |
29 | pub fn set_value(&mut self, x: f64, y: f64) {
30 | self.x = x;
31 | self.y = y;
32 | }
33 |
34 | pub fn sort_value(&self) -> u32 {
35 | self.capability as u32
36 | }
37 | }
38 |
39 | impl Widget for &AxisGauge {
40 | fn render(self, area: Rect, buf: &mut Buffer) {
41 | let canvas = Canvas::default()
42 | .block(Block::bordered().title(self.text.as_str()))
43 | .marker(ratatui::symbols::Marker::Braille)
44 | .x_bounds([-100.0, 100.0])
45 | .y_bounds([-100.0, 100.0])
46 | .paint(|ctx| {
47 | // Draw the edges
48 | let circle = Circle {
49 | radius: 100.0,
50 | ..Default::default()
51 | };
52 | ctx.draw(&circle);
53 |
54 | // Draw the current position
55 | for radius in 0..10 {
56 | let cursor = Circle {
57 | x: self.x * 100.0,
58 | y: self.y * 100.0,
59 | radius: radius as f64,
60 | color: Color::LightRed,
61 | };
62 | ctx.draw(&cursor);
63 | }
64 |
65 | // Draw the coordinates
66 | ctx.print(
67 | 0.0,
68 | 0.0,
69 | format!(
70 | "({}, {})",
71 | (self.x * 100.0).round(),
72 | (self.y * 100.0).round()
73 | ),
74 | );
75 | });
76 | canvas.render(area, buf);
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/cli/ui/widgets/button_gauge.rs:
--------------------------------------------------------------------------------
1 | use ratatui::{
2 | prelude::*,
3 | style::Style,
4 | symbols::border,
5 | widgets::{Block, Gauge, Widget},
6 | };
7 |
8 | use crate::drivers::unified_gamepad::capability::InputCapability;
9 |
10 | #[derive(Debug, Default)]
11 | pub struct ButtonGauge {
12 | text: String,
13 | capability: InputCapability,
14 | value: bool,
15 | }
16 |
17 | impl ButtonGauge {
18 | pub fn new(capability: InputCapability, text: &str) -> Self {
19 | Self {
20 | text: text.to_string(),
21 | capability,
22 | value: false,
23 | }
24 | }
25 |
26 | pub fn set_value(&mut self, value: bool) {
27 | self.value = value;
28 | }
29 |
30 | pub fn sort_value(&self) -> u32 {
31 | self.capability as u32
32 | }
33 | }
34 |
35 | impl Widget for &ButtonGauge {
36 | fn render(self, area: Rect, buf: &mut Buffer) {
37 | // Choose the style based on the value
38 | let style = if self.value {
39 | Style::new().green()
40 | } else {
41 | Style::new().gray()
42 | };
43 |
44 | // Create a block
45 | let block = Block::bordered()
46 | .title(self.text.as_str())
47 | .border_set(border::ROUNDED)
48 | .border_style(style);
49 | let inside_block = block.inner(area);
50 | block.render(area, buf);
51 |
52 | // Create the gauge
53 | let color = if self.value {
54 | Color::Indexed(93)
55 | } else {
56 | Color::Indexed(105)
57 | };
58 | let gauge = Gauge::default().ratio(1.0).gauge_style(color).label("");
59 | gauge.render(inside_block, buf);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/cli/ui/widgets/touch_gauge.rs:
--------------------------------------------------------------------------------
1 | use ratatui::{
2 | prelude::*,
3 | widgets::{
4 | canvas::{Canvas, Circle},
5 | Block, Widget,
6 | },
7 | };
8 |
9 | use crate::drivers::unified_gamepad::capability::InputCapability;
10 |
11 | #[derive(Debug, Default)]
12 | pub struct TouchGauge {
13 | text: String,
14 | capability: InputCapability,
15 | x: f64,
16 | y: f64,
17 | touching: bool,
18 | }
19 |
20 | impl TouchGauge {
21 | pub fn new(capability: InputCapability, text: &str) -> Self {
22 | Self {
23 | text: text.to_string(),
24 | capability,
25 | x: 0.0,
26 | y: 0.0,
27 | touching: false,
28 | }
29 | }
30 |
31 | pub fn set_value(&mut self, x: f64, y: f64, touching: bool) {
32 | self.x = x;
33 | self.y = y;
34 | self.touching = touching;
35 | }
36 |
37 | pub fn sort_value(&self) -> u32 {
38 | self.capability as u32
39 | }
40 | }
41 |
42 | impl Widget for &TouchGauge {
43 | fn render(self, area: Rect, buf: &mut Buffer) {
44 | let canvas = Canvas::default()
45 | .block(Block::bordered().title(self.text.as_str()))
46 | .marker(ratatui::symbols::Marker::Braille)
47 | .x_bounds([0.0, 100.0])
48 | .y_bounds([0.0, 100.0])
49 | .paint(|ctx| {
50 | let x = self.x;
51 | let y = (1.0 - self.y).abs();
52 |
53 | // Draw the current position
54 | if self.touching {
55 | for radius in 0..10 {
56 | let cursor = Circle {
57 | x: x * 100.0,
58 | y: y * 100.0,
59 | radius: radius as f64,
60 | color: Color::LightRed,
61 | };
62 | ctx.draw(&cursor);
63 | }
64 | }
65 |
66 | // Draw the coordinates
67 | ctx.print(
68 | 50.0,
69 | 50.0,
70 | format!("({}, {})", (x * 100.0).round(), (y * 100.0).round()),
71 | );
72 | });
73 | canvas.render(area, buf);
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/cli/ui/widgets/trigger_gauge.rs:
--------------------------------------------------------------------------------
1 | use ratatui::{
2 | prelude::*,
3 | style::Style,
4 | symbols::border,
5 | widgets::{Block, Gauge, Widget},
6 | };
7 |
8 | use crate::drivers::unified_gamepad::capability::InputCapability;
9 |
10 | #[derive(Debug, Default)]
11 | pub struct TriggerGauge {
12 | text: String,
13 | capability: InputCapability,
14 | value: f64,
15 | }
16 |
17 | impl TriggerGauge {
18 | pub fn new(capability: InputCapability, text: &str) -> Self {
19 | Self {
20 | text: text.to_string(),
21 | capability,
22 | value: 0.0,
23 | }
24 | }
25 |
26 | pub fn set_value(&mut self, value: f64) {
27 | if value > 1.0 {
28 | return;
29 | }
30 | self.value = value;
31 | }
32 |
33 | pub fn sort_value(&self) -> u32 {
34 | self.capability as u32
35 | }
36 | }
37 |
38 | impl Widget for &TriggerGauge {
39 | fn render(self, area: Rect, buf: &mut Buffer) {
40 | // Create a block
41 | let block = Block::bordered()
42 | .title(self.text.as_str())
43 | .border_set(border::ROUNDED)
44 | .border_style(Style::new());
45 | let inside_block = block.inner(area);
46 | block.render(area, buf);
47 |
48 | // Set the color based on the value
49 | let color = {
50 | if self.value < 0.2 {
51 | Color::Indexed(53)
52 | } else if self.value < 0.4 {
53 | Color::Indexed(54)
54 | } else if self.value < 0.6 {
55 | Color::Indexed(55)
56 | } else if self.value < 0.8 {
57 | Color::Indexed(56)
58 | } else {
59 | Color::Indexed(57)
60 | }
61 | };
62 |
63 | // Create the gauge
64 | let gauge = Gauge::default().gauge_style(color).ratio(self.value);
65 | gauge.render(inside_block, buf);
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/config/capability_map/hidraw.rs:
--------------------------------------------------------------------------------
1 | use schemars::JsonSchema;
2 | use serde::{Deserialize, Serialize};
3 |
4 | /// A [HidrawConfig] defines how to decode a particular event in an HID input
5 | /// report.
6 | #[derive(Debug, Deserialize, Serialize, Clone, JsonSchema, PartialEq)]
7 | #[serde(rename_all = "snake_case")]
8 | pub struct HidrawConfig {
9 | pub report_id: u32,
10 | pub input_type: String,
11 | pub byte_start: u64,
12 | pub bit_offset: u8,
13 | }
14 |
--------------------------------------------------------------------------------
/src/constants.rs:
--------------------------------------------------------------------------------
1 | pub const BUS_NAME: &str = "org.shadowblip.InputPlumber";
2 | pub const BUS_PREFIX: &str = "/org/shadowblip/InputPlumber";
3 | pub const BUS_SOURCES_PREFIX: &str = "/org/shadowblip/InputPlumber/devices/source";
4 | pub const BUS_TARGETS_PREFIX: &str = "/org/shadowblip/InputPlumber/devices/target";
5 |
--------------------------------------------------------------------------------
/src/dbus/interface/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod composite_device;
2 | pub mod manager;
3 | pub mod source;
4 | pub mod target;
5 |
--------------------------------------------------------------------------------
/src/dbus/interface/source/led.rs:
--------------------------------------------------------------------------------
1 | use crate::input::source::iio::get_dbus_path;
2 | use crate::udev::device::UdevDevice;
3 | use std::error::Error;
4 | use zbus::{fdo, Connection};
5 | use zbus_macros::interface;
6 |
7 | /// DBusInterface exposing information about a led device
8 | pub struct SourceLedInterface {
9 | device: UdevDevice,
10 | }
11 |
12 | impl SourceLedInterface {
13 | pub fn new(device: UdevDevice) -> SourceLedInterface {
14 | SourceLedInterface { device }
15 | }
16 | /// Creates a new instance of the source led interface on DBus. Returns
17 | /// a structure with information about the source device.
18 | pub async fn listen_on_dbus(
19 | conn: Connection,
20 | device: UdevDevice,
21 | ) -> Result<(), Box> {
22 | let iface = SourceLedInterface::new(device);
23 | let Ok(id) = iface.id() else {
24 | return Ok(());
25 | };
26 | let path = get_dbus_path(id);
27 | tokio::task::spawn(async move {
28 | log::debug!("Starting dbus interface: {path}");
29 | let result = conn.object_server().at(path.clone(), iface).await;
30 | if let Err(e) = result {
31 | log::debug!("Failed to start dbus interface {path}: {e:?}");
32 | } else {
33 | log::debug!("Started dbus interface: {path}");
34 | }
35 | });
36 | Ok(())
37 | }
38 | }
39 |
40 | #[interface(name = "org.shadowblip.Input.Source.LEDDevice")]
41 | impl SourceLedInterface {
42 | /// Returns the human readable name of the device (e.g. XBox 360 Pad)
43 | #[zbus(property)]
44 | fn id(&self) -> fdo::Result {
45 | Ok(self.device.sysname())
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/dbus/interface/source/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod evdev;
2 | pub mod hidraw;
3 | pub mod iio_imu;
4 | pub mod led;
5 | pub mod udev;
6 |
--------------------------------------------------------------------------------
/src/dbus/interface/target/dbus.rs:
--------------------------------------------------------------------------------
1 | use zbus::{fdo, object_server::SignalEmitter};
2 | use zbus_macros::interface;
3 |
4 | /// The [TargetDBusInterface] provides a DBus interface that can be exposed for managing
5 | /// a [DBusDevice]. It works by sending command messages to a channel that the
6 | /// [DBusDevice] is listening on.
7 | pub struct TargetDBusInterface {}
8 |
9 | impl TargetDBusInterface {
10 | pub fn new() -> TargetDBusInterface {
11 | TargetDBusInterface {}
12 | }
13 | }
14 |
15 | impl Default for TargetDBusInterface {
16 | fn default() -> Self {
17 | Self::new()
18 | }
19 | }
20 |
21 | #[interface(name = "org.shadowblip.Input.DBusDevice")]
22 | impl TargetDBusInterface {
23 | /// Name of the DBus device
24 | #[zbus(property)]
25 | async fn name(&self) -> fdo::Result {
26 | Ok("DBusDevice".into())
27 | }
28 |
29 | /// Emitted when an input event occurs
30 | #[zbus(signal)]
31 | pub async fn input_event(
32 | ctxt: &SignalEmitter<'_>,
33 | event: String,
34 | value: f64,
35 | ) -> zbus::Result<()>;
36 |
37 | /// Emitted when a touch event occurs.
38 | #[zbus(signal)]
39 | pub async fn touch_event(
40 | ctxt: &SignalEmitter<'_>,
41 | event: String,
42 | index: u32,
43 | is_touching: bool,
44 | pressure: f64,
45 | x: f64,
46 | y: f64,
47 | ) -> zbus::Result<()>;
48 | }
49 |
--------------------------------------------------------------------------------
/src/dbus/interface/target/debug.rs:
--------------------------------------------------------------------------------
1 | use zbus::{fdo, object_server::SignalEmitter};
2 | use zbus_macros::interface;
3 |
4 | use crate::drivers::unified_gamepad::reports::input_capability_report::InputCapabilityReport;
5 |
6 | /// The [TargetDBusInterface] provides a DBus interface that can be exposed for managing
7 | /// a [DBusDevice]. It works by sending command messages to a channel that the
8 | /// [DBusDevice] is listening on.
9 | pub struct TargetDebugInterface {
10 | pub capability_report: InputCapabilityReport,
11 | }
12 |
13 | impl TargetDebugInterface {
14 | pub fn new() -> TargetDebugInterface {
15 | TargetDebugInterface {
16 | capability_report: InputCapabilityReport::default(),
17 | }
18 | }
19 | }
20 |
21 | impl Default for TargetDebugInterface {
22 | fn default() -> Self {
23 | Self::new()
24 | }
25 | }
26 |
27 | #[interface(
28 | name = "org.shadowblip.Input.Debug",
29 | proxy(default_service = "org.shadowblip.InputPlumber",)
30 | )]
31 | impl TargetDebugInterface {
32 | /// Returns the input capability report data that can be used to decode
33 | /// the values from the input report.
34 | #[zbus(property)]
35 | pub async fn input_capability_report(&self) -> fdo::Result> {
36 | let data = self
37 | .capability_report
38 | .pack_to_vec()
39 | .map_err(|e| fdo::Error::Failed(e.to_string()))?;
40 | Ok(data)
41 | }
42 |
43 | /// Emitted when a input is emitted.
44 | #[zbus(signal)]
45 | pub async fn input_report(emitter: &SignalEmitter<'_>, data: Vec) -> zbus::Result<()>;
46 | }
47 |
--------------------------------------------------------------------------------
/src/dbus/interface/target/gamepad.rs:
--------------------------------------------------------------------------------
1 | use zbus::fdo;
2 | use zbus_macros::interface;
3 |
4 | /// The [TargetGamepadInterface] provides a DBus interface that can be exposed for managing
5 | /// a [GenericGamepad].
6 | pub struct TargetGamepadInterface {
7 | dev_name: String,
8 | }
9 |
10 | impl TargetGamepadInterface {
11 | pub fn new(dev_name: String) -> TargetGamepadInterface {
12 | TargetGamepadInterface { dev_name }
13 | }
14 | }
15 |
16 | impl Default for TargetGamepadInterface {
17 | fn default() -> Self {
18 | Self::new("Gamepad".to_string())
19 | }
20 | }
21 |
22 | #[interface(name = "org.shadowblip.Input.Gamepad")]
23 | impl TargetGamepadInterface {
24 | /// Name of the DBus device
25 | #[zbus(property)]
26 | async fn name(&self) -> fdo::Result {
27 | Ok(self.dev_name.clone())
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/dbus/interface/target/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod dbus;
2 | pub mod debug;
3 | pub mod gamepad;
4 | pub mod keyboard;
5 | pub mod mouse;
6 | pub mod touchscreen;
7 |
8 | use zbus::fdo;
9 | use zbus_macros::interface;
10 |
11 | use crate::input::target::TargetDeviceTypeId;
12 |
13 | /// The [TargetInterface] provides a DBus interface that can be exposed for managing
14 | /// a target input device.
15 | pub struct TargetInterface {
16 | dev_name: String,
17 | device_type: String,
18 | }
19 |
20 | impl TargetInterface {
21 | pub fn new(device_type: &TargetDeviceTypeId) -> TargetInterface {
22 | TargetInterface {
23 | dev_name: device_type.name().to_owned(),
24 | device_type: device_type.as_str().to_owned(),
25 | }
26 | }
27 | }
28 |
29 | #[interface(
30 | name = "org.shadowblip.Input.Target",
31 | proxy(default_service = "org.shadowblip.InputPlumber",)
32 | )]
33 | impl TargetInterface {
34 | /// Name of the DBus device
35 | #[zbus(property)]
36 | async fn name(&self) -> fdo::Result {
37 | Ok(self.dev_name.clone())
38 | }
39 |
40 | #[zbus(property)]
41 | async fn device_type(&self) -> fdo::Result {
42 | Ok(self.device_type.clone())
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/dbus/interface/target/mouse.rs:
--------------------------------------------------------------------------------
1 | use zbus::fdo;
2 | use zbus_macros::interface;
3 |
4 | use crate::input::{
5 | capability::{Capability, Mouse},
6 | event::{native::NativeEvent, value::InputValue},
7 | target::client::TargetDeviceClient,
8 | };
9 |
10 | /// The [TargetMouseInterface] provides a DBus interface that can be exposed for managing
11 | /// a [MouseDevice]. It works by sending command messages to a channel that the
12 | /// [MouseDevice] is listening on.
13 | pub struct TargetMouseInterface {
14 | target_device: TargetDeviceClient,
15 | }
16 |
17 | impl TargetMouseInterface {
18 | pub fn new(target_device: TargetDeviceClient) -> TargetMouseInterface {
19 | TargetMouseInterface { target_device }
20 | }
21 | }
22 |
23 | #[interface(name = "org.shadowblip.Input.Mouse")]
24 | impl TargetMouseInterface {
25 | /// Name of the composite device
26 | #[zbus(property)]
27 | async fn name(&self) -> fdo::Result {
28 | Ok("Mouse".into())
29 | }
30 |
31 | /// Move the virtual mouse by the given amount relative to the cursor's
32 | /// relative position.
33 | async fn move_cursor(&self, x: i32, y: i32) -> fdo::Result<()> {
34 | // Create a mouse motion event
35 | let value = InputValue::Vector2 {
36 | x: Some(x as f64),
37 | y: Some(y as f64),
38 | };
39 | let event = NativeEvent::new(Capability::Mouse(Mouse::Motion), value);
40 |
41 | // Write the event to the virtual mouse
42 | self.target_device
43 | .write_event(event)
44 | .await
45 | .map_err(|err| fdo::Error::Failed(err.to_string()))?;
46 |
47 | Ok(())
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/dbus/interface/target/touchscreen.rs:
--------------------------------------------------------------------------------
1 | use zbus::fdo;
2 | use zbus_macros::interface;
3 |
4 | /// The [TargetTouchscreenInterface] provides a DBus interface that can be exposed for managing
5 | /// a [TouchscreenDevice]. It works by sending command messages to a channel that the
6 | /// [TouchscreenDevice] is listening on.
7 | pub struct TargetTouchscreenInterface {}
8 |
9 | impl TargetTouchscreenInterface {
10 | pub fn new() -> TargetTouchscreenInterface {
11 | TargetTouchscreenInterface {}
12 | }
13 | }
14 |
15 | impl Default for TargetTouchscreenInterface {
16 | fn default() -> Self {
17 | Self::new()
18 | }
19 | }
20 |
21 | #[interface(name = "org.shadowblip.Input.Touchscreen")]
22 | impl TargetTouchscreenInterface {
23 | /// Name of the target device
24 | #[zbus(property)]
25 | async fn name(&self) -> fdo::Result {
26 | Ok("Touchscreen".into())
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/dbus/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod interface;
2 |
--------------------------------------------------------------------------------
/src/dmi/data.rs:
--------------------------------------------------------------------------------
1 | /// Container for system DMI data
2 | #[derive(Debug, Clone, Default)]
3 | pub struct DMIData {
4 | pub bios_date: String,
5 | pub bios_release: String,
6 | pub bios_vendor: String,
7 | pub bios_version: String,
8 | pub board_asset_tag: String,
9 | pub board_name: String,
10 | pub board_vendor: String,
11 | pub board_version: String,
12 | pub chassis_asset_tag: String,
13 | pub chassis_type: String,
14 | pub chassis_vendor: String,
15 | pub chassis_version: String,
16 | pub product_family: String,
17 | pub product_name: String,
18 | pub product_sku: String,
19 | pub product_version: String,
20 | pub sys_vendor: String,
21 | }
22 |
--------------------------------------------------------------------------------
/src/dmi/mod.rs:
--------------------------------------------------------------------------------
1 | use std::fs;
2 |
3 | use procfs::{CpuInfo, Current};
4 |
5 | use self::data::DMIData;
6 |
7 | pub mod data;
8 |
9 | /// Returns DMI data from the system
10 | pub fn get_dmi_data() -> DMIData {
11 | let bios_date = get_dmi_property("bios_date");
12 | let bios_release = get_dmi_property("bios_release");
13 | let bios_vendor = get_dmi_property("bios_vendor");
14 | let bios_version = get_dmi_property("bios_version");
15 | let board_asset_tag = get_dmi_property("board_asset_tag");
16 | let board_name = get_dmi_property("board_name");
17 | let board_vendor = get_dmi_property("board_vendor");
18 | let board_version = get_dmi_property("board_version");
19 | let chassis_asset_tag = get_dmi_property("chassis_asset_tag");
20 | let chassis_type = get_dmi_property("chassis_type");
21 | let chassis_vendor = get_dmi_property("chassis_vendor");
22 | let chassis_version = get_dmi_property("chassis_version");
23 | let product_family = get_dmi_property("product_family");
24 | let product_name = get_dmi_property("product_name");
25 | let product_sku = get_dmi_property("product_sku");
26 | let product_version = get_dmi_property("product_version");
27 | let sys_vendor = get_dmi_property("sys_vendor");
28 |
29 | DMIData {
30 | bios_date,
31 | bios_release,
32 | bios_vendor,
33 | bios_version,
34 | board_asset_tag,
35 | board_name,
36 | board_vendor,
37 | board_version,
38 | chassis_asset_tag,
39 | chassis_type,
40 | chassis_vendor,
41 | chassis_version,
42 | product_family,
43 | product_name,
44 | product_sku,
45 | product_version,
46 | sys_vendor,
47 | }
48 | }
49 |
50 | /// Returns the CPU info from the system
51 | pub fn get_cpu_info() -> Result {
52 | CpuInfo::current()
53 | }
54 |
55 | /// Read the given DMI property
56 | fn get_dmi_property(name: &str) -> String {
57 | let path = format!("/sys/devices/virtual/dmi/id/{name}");
58 | fs::read_to_string(path)
59 | .unwrap_or_default()
60 | .replace('\n', "")
61 | }
62 |
--------------------------------------------------------------------------------
/src/drivers/dualsense/event.rs:
--------------------------------------------------------------------------------
1 | /// Events that can be emitted by the DualSense controller
2 | #[derive(Clone, Debug)]
3 | pub enum Event {
4 | Button(ButtonEvent),
5 | Accelerometer(AccelerometerEvent),
6 | Axis(AxisEvent),
7 | Trigger(TriggerEvent),
8 | }
9 |
10 | /// Binary input contain either pressed or unpressed
11 | #[derive(Clone, Debug)]
12 | pub struct BinaryInput {
13 | pub pressed: bool,
14 | }
15 |
16 | /// Button events represend binary inputs
17 | #[derive(Clone, Debug)]
18 | pub enum ButtonEvent {
19 | Cross(BinaryInput),
20 | Circle(BinaryInput),
21 | Square(BinaryInput),
22 | Triangle(BinaryInput),
23 | Create(BinaryInput),
24 | Options(BinaryInput),
25 | Guide(BinaryInput),
26 | Mute(BinaryInput),
27 | DPadDown(BinaryInput),
28 | DPadUp(BinaryInput),
29 | DPadLeft(BinaryInput),
30 | DPadRight(BinaryInput),
31 | L1(BinaryInput),
32 | L2(BinaryInput),
33 | L3(BinaryInput),
34 | L4(BinaryInput),
35 | L5(BinaryInput),
36 | R1(BinaryInput),
37 | R2(BinaryInput),
38 | R3(BinaryInput),
39 | R4(BinaryInput),
40 | R5(BinaryInput),
41 | PadPress(BinaryInput),
42 | }
43 |
44 | /// Axis input contain (x, y) coordinates
45 | #[derive(Clone, Debug)]
46 | pub struct AxisInput {
47 | pub x: u8,
48 | pub y: u8,
49 | }
50 |
51 | /// Axis input contain (x, y) coordinates
52 | #[derive(Clone, Debug)]
53 | pub struct TouchAxisInput {
54 | pub index: u8,
55 | pub is_touching: bool,
56 | pub x: u16,
57 | pub y: u16,
58 | }
59 |
60 | /// Axis events are events that have (x, y) values
61 | #[derive(Clone, Debug)]
62 | pub enum AxisEvent {
63 | Pad(TouchAxisInput),
64 | LStick(AxisInput),
65 | RStick(AxisInput),
66 | }
67 |
68 | /// Trigger input contains non-negative integars
69 | #[derive(Clone, Debug)]
70 | pub struct TriggerInput {
71 | pub value: u8,
72 | }
73 |
74 | /// Trigger events contain positive values indicating how far a trigger is pulled
75 | #[derive(Clone, Debug)]
76 | pub enum TriggerEvent {
77 | L2(TriggerInput),
78 | R2(TriggerInput),
79 | }
80 |
81 | /// AccelerometerInput represents the state of the accelerometer (x, y, z) values
82 | #[derive(Clone, Debug)]
83 | pub struct AccelerometerInput {
84 | pub x: i16,
85 | pub y: i16,
86 | pub z: i16,
87 | }
88 |
89 | /// AccelerometerEvent has data from the accelerometer
90 | #[derive(Clone, Debug)]
91 | pub enum AccelerometerEvent {
92 | Accelerometer(AccelerometerInput),
93 | /// Pitch, yaw, roll
94 | Gyro(AccelerometerInput),
95 | }
96 |
--------------------------------------------------------------------------------
/src/drivers/dualsense/hid_report_test.rs:
--------------------------------------------------------------------------------
1 | use std::error::Error;
2 |
3 | use packed_struct::PackedStructSlice;
4 |
5 | use crate::drivers::dualsense::hid_report::InputState;
6 |
7 | #[tokio::test]
8 | async fn test_ds_hid() -> Result<(), Box> {
9 | let mut report = InputState::default();
10 | println!("Before Report: {}", report.touch_data.touch_finger_data[0]);
11 | report.touch_data.touch_finger_data[0].set_y(1068);
12 | report.touch_data.touch_finger_data[0].set_x(1919);
13 | assert_eq!(report.touch_data.touch_finger_data[0].get_y(), 1068);
14 | assert_eq!(report.touch_data.touch_finger_data[0].get_x(), 1919);
15 |
16 | println!("After Report: {}", report.touch_data.touch_finger_data[0]);
17 | assert_eq!(
18 | report.touch_data.touch_finger_data[0]
19 | .pack_to_vec()
20 | .unwrap(),
21 | vec![0x80, 0x7F, 0xC7, 0x42]
22 | );
23 |
24 | Ok(())
25 | }
26 |
--------------------------------------------------------------------------------
/src/drivers/dualsense/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver;
2 | pub mod event;
3 | pub mod hid_report;
4 | #[cfg(test)]
5 | mod hid_report_test;
6 | pub mod report_descriptor;
7 |
--------------------------------------------------------------------------------
/src/drivers/dualshock4/report_descriptors.rs:
--------------------------------------------------------------------------------
1 | // Report descriptor of DualShock4 dumped by ashtophet101 to help developing the first working version ROGueENEMY.
2 | // He also provided captures and help in many other ways. Than you very much!
3 |
--------------------------------------------------------------------------------
/src/drivers/flydigi_vader_4_pro/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver;
2 | pub mod event;
3 | pub mod hid_report;
4 | pub mod report_descriptor;
5 |
--------------------------------------------------------------------------------
/src/drivers/fts3528/event.rs:
--------------------------------------------------------------------------------
1 | use super::hid_report::TouchData;
2 |
3 | pub enum Event {
4 | Touch(TouchAxisInput),
5 | }
6 |
7 | /// Axis input contain (x, y) coordinates
8 | #[derive(Clone, Debug)]
9 | pub struct TouchAxisInput {
10 | pub index: u8,
11 | pub is_touching: bool,
12 | pub x: u16,
13 | pub y: u16,
14 | }
15 |
16 | impl From for TouchAxisInput {
17 | fn from(touch_data: TouchData) -> Self {
18 | let index = touch_data.contact_id;
19 | let is_touching = touch_data.is_touching();
20 | let (x, y) = match is_touching {
21 | true => (touch_data.get_x(), touch_data.get_y()),
22 | false => (0, 0),
23 | };
24 | Self {
25 | index,
26 | is_touching,
27 | x,
28 | y,
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/drivers/fts3528/hid_report_test.rs:
--------------------------------------------------------------------------------
1 | use std::error::Error;
2 |
3 | use packed_struct::{
4 | types::{Integer, SizedInteger},
5 | PackedStruct,
6 | };
7 |
8 | use crate::drivers::fts3528::hid_report::PackedInputDataReport;
9 |
10 | // Example packet:
11 | // # ReportID: 1 / Tip Switch: 1 | # | # | Contact Id: 0 | X: 442 , 442 | Y: 381 , 381 | Width: 48 | Height: 48
12 | // # | Tip Switch: 0 | # | # | Contact Id: 15 | X: 4095 , 4095 | Y: 4095 , 4095 | Width: 48 | Height: 48
13 | // # | Tip Switch: 0 | # | # | Contact Id: 15 | X: 4095 , 4095 | Y: 4095 , 4095 | Width: 48 | Height: 48
14 | // # | Tip Switch: 0 | # | # | Contact Id: 15 | X: 4095 , 4095 | Y: 4095 , 4095 | Width: 48 | Height: 48 | Scan Time: 53800 | Contact Count: 1
15 | // E: 000788.304103 60 01 01 00 ba 01 ba 01 7d 01 7d 01 30 00 30 00 00 0f ff 0f ff 0f ff 0f ff 0f 30 00 30 00 00 0f ff 0f ff 0f ff 0f ff 0f 30 00 30 00 00 0f ff 0f ff 0f ff 0f ff 0f 30 00 30 00 28 d2 01
16 |
17 | #[tokio::test]
18 | async fn test_opi_hid() -> Result<(), Box> {
19 | let mut report = PackedInputDataReport::default();
20 | println!("Before Report: {}", report);
21 | report.touch1.tip_switch = 1;
22 | report.touch1.contact_id = 0;
23 | report.touch1.set_x(442);
24 | report.touch1.set_x2(442);
25 | report.touch1.set_y(381);
26 | report.touch1.set_y2(381);
27 | report.scan_time = Integer::from_primitive(53800);
28 | report.contact_count = 1;
29 |
30 | println!("After Report: {}", report);
31 |
32 | let expected: [u8; 60] = [
33 | 0x01, 0x01, 0x00, 0xba, 0x01, 0xba, 0x01, 0x7d, 0x01, 0x7d, 0x01, 0x30, 0x00, 0x30, 0x00,
34 | 0x00, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0x30, 0x00, 0x30, 0x00, 0x00,
35 | 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0x30, 0x00, 0x30, 0x00, 0x00, 0x0f,
36 | 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0x30, 0x00, 0x30, 0x00, 0x28, 0xd2, 0x01,
37 | ];
38 | let packed = report.pack().unwrap();
39 |
40 | assert_eq!(expected, packed);
41 |
42 | Ok(())
43 | }
44 |
--------------------------------------------------------------------------------
/src/drivers/fts3528/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver;
2 | pub mod event;
3 | pub mod hid_report;
4 | #[cfg(test)]
5 | pub mod hid_report_test;
6 | pub mod report_descriptor;
7 |
--------------------------------------------------------------------------------
/src/drivers/horipad_steam/hid_report_test.rs:
--------------------------------------------------------------------------------
1 | use std::error::Error;
2 |
3 | use packed_struct::PackedStructSlice;
4 |
5 | use super::hid_report::PackedInputDataReport;
6 |
7 | #[tokio::test]
8 | async fn test_horipad_steam() -> Result<(), Box> {
9 | let report = PackedInputDataReport::unpack_from_slice(&DATA_A).unwrap();
10 | println!("{report}");
11 | assert!(report.a, "should be pressed");
12 |
13 | Ok(())
14 | }
15 |
16 | const DATA_A: [u8; 287] = [
17 | 0x07, 0x80, 0x80, 0x80, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x3d, 0x8b, 0xfb, 0xff, 0x21, 0x00,
18 | 0x20, 0x00, 0x34, 0x03, 0x70, 0xf0, 0x20, 0x00, 0x19, 0x01, 0x80, 0x00, 0x00, 0x02, 0x80, 0x80,
19 | 0x80, 0x80, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x8c, 0xfb, 0xff, 0x21, 0x00, 0x20, 0x00, 0x34,
20 | 0x03, 0x70, 0xf0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
22 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
24 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa9, 0x45, 0xe9, 0xbf,
35 | ];
36 |
--------------------------------------------------------------------------------
/src/drivers/horipad_steam/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver;
2 | pub mod event;
3 | pub mod hid_report;
4 | #[cfg(test)]
5 | pub mod hid_report_test;
6 | pub mod report_descriptor;
7 |
--------------------------------------------------------------------------------
/src/drivers/iio_imu/event.rs:
--------------------------------------------------------------------------------
1 | /// Events that can be emitted by the BMI IMU
2 | #[derive(Clone, Debug)]
3 | pub enum Event {
4 | /// Accelerometer events measure the acceleration in a particular direction
5 | /// in units of meters per second. It is generally used to determine which
6 | /// direction is "down" due to the accelerating force of gravity.
7 | Accelerometer(AxisData),
8 | /// Gyro events measure the angular velocity in rads per second.
9 | Gyro(AxisData),
10 | }
11 |
12 | /// AxisData represents the state of the accelerometer or gyro (x, y, z) values
13 | #[derive(Clone, Debug, Default)]
14 | pub struct AxisData {
15 | pub x: f64,
16 | pub y: f64,
17 | pub z: f64,
18 | }
19 |
--------------------------------------------------------------------------------
/src/drivers/iio_imu/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver;
2 | pub mod event;
3 | pub mod info;
4 |
--------------------------------------------------------------------------------
/src/drivers/lego/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver_dinput_combined;
2 | pub mod driver_dinput_split;
3 | pub mod driver_fps_mode;
4 | pub mod driver_xinput;
5 | pub mod event;
6 | pub mod hid_report;
7 |
--------------------------------------------------------------------------------
/src/drivers/legos/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod config_driver;
2 | pub mod event;
3 | pub mod hid_report;
4 | pub mod imu_driver;
5 | pub mod touchpad_driver;
6 | pub mod xinput_driver;
7 |
8 | // Hardware ID's
9 | pub const VID: u16 = 0x1a86;
10 | pub const XINPUT_PID: u16 = 0xe310;
11 | pub const DINPUT_PID: u16 = 0xe311;
12 | pub const PIDS: [u16; 2] = [XINPUT_PID, DINPUT_PID];
13 |
14 | pub const CFG_IID: i32 = 0x3;
15 | pub const TP_IID: i32 = 0x2;
16 | pub const IMU_IID: i32 = 0x5;
17 | pub const GP_IID: i32 = 0x6;
18 |
19 | // Input report sizes
20 | const INERTIAL_PACKET_SIZE: usize = 9;
21 | const TOUCH_PACKET_SIZE: usize = 10;
22 | const XINPUT_PACKET_SIZE: usize = 32;
23 |
24 | // Input report axis ranges
25 | pub const GYRO_SCALE: i16 = 2;
26 | pub const PAD_FORCE_MAX: f64 = 127.0;
27 | pub const PAD_FORCE_NORMAL: u8 = 32; /* Simulated average pressure */
28 | pub const PAD_MOTION_MAX: f64 = 400.0;
29 | pub const STICK_X_MAX: f64 = 127.0;
30 | pub const STICK_X_MIN: f64 = -127.0;
31 | pub const STICK_Y_MAX: f64 = 127.0;
32 | pub const STICK_Y_MIN: f64 = -127.0;
33 | pub const TRIGG_MAX: f64 = 255.0;
34 |
35 | // Report ID's
36 | const TOUCH_REPORT_ID: u8 = 0x31;
37 |
38 | // Timeouts
39 | const HID_TIMEOUT: i32 = 10;
40 |
--------------------------------------------------------------------------------
/src/drivers/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod dualsense;
2 | pub mod flydigi_vader_4_pro;
3 | pub mod fts3528;
4 | pub mod horipad_steam;
5 | pub mod iio_imu;
6 | pub mod lego;
7 | pub mod legos;
8 | pub mod msi_claw;
9 | pub mod opineo;
10 | pub mod rog_ally;
11 | pub mod steam_deck;
12 | pub mod unified_gamepad;
13 | pub mod xpad_uhid;
14 | pub mod zotac_zone;
15 |
--------------------------------------------------------------------------------
/src/drivers/msi_claw/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver;
2 | pub mod hid_report;
3 |
--------------------------------------------------------------------------------
/src/drivers/opineo/event.rs:
--------------------------------------------------------------------------------
1 | /// Events that can be emitted by the Steam Deck controller
2 | #[derive(Clone, Debug)]
3 | pub enum Event {
4 | TouchAxis(TouchAxisEvent),
5 | TouchButton(TouchButtonEvent),
6 | }
7 |
8 | /// Axis input contain (x, y) coordinates
9 | #[derive(Clone, Debug)]
10 | pub struct TouchAxisEvent {
11 | pub index: u8,
12 | pub is_touching: bool,
13 | pub x: u16,
14 | pub y: u16,
15 | }
16 |
17 | /// Binary input contain either pressed or unpressed
18 | #[derive(Clone, Debug)]
19 | pub struct BinaryInput {
20 | pub pressed: bool,
21 | }
22 |
23 | /// Button events represend binary inputs
24 | #[derive(Clone, Debug)]
25 | pub enum TouchButtonEvent {
26 | /// Tap to click button
27 | Left(BinaryInput),
28 | }
29 |
--------------------------------------------------------------------------------
/src/drivers/opineo/hid_report_test.rs:
--------------------------------------------------------------------------------
1 | use std::error::Error;
2 |
3 | use packed_struct::types::{Integer, SizedInteger};
4 |
5 | use crate::drivers::opineo::hid_report::TouchpadDataReport;
6 |
7 | #[tokio::test]
8 | async fn test_opi_hid() -> Result<(), Box> {
9 | let mut report = TouchpadDataReport::default();
10 | println!("Before Report: {}", report);
11 | report.touch_x = Integer::from_primitive(467);
12 | report.touch_y = Integer::from_primitive(512);
13 |
14 | println!("After Report: {}", report);
15 | assert_eq!(report.touch_x.to_primitive(), 467);
16 | assert_eq!(report.touch_y.to_primitive(), 512);
17 |
18 | Ok(())
19 | }
20 |
--------------------------------------------------------------------------------
/src/drivers/opineo/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver;
2 | pub mod event;
3 | pub mod hid_report;
4 | #[cfg(test)]
5 | pub mod hid_report_test;
6 |
--------------------------------------------------------------------------------
/src/drivers/rog_ally/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver;
2 |
--------------------------------------------------------------------------------
/src/drivers/steam_deck/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver;
2 | pub mod event;
3 | pub mod hid_report;
4 | pub mod report_descriptor;
5 |
--------------------------------------------------------------------------------
/src/drivers/unified_gamepad/event.rs:
--------------------------------------------------------------------------------
1 | use super::{capability::InputCapability, value::Value};
2 |
3 | /// Events that can be emitted by the Unified Controller
4 | #[derive(Clone, Debug, Default)]
5 | pub struct Event {
6 | #[allow(dead_code)]
7 | pub capability: InputCapability,
8 | #[allow(dead_code)]
9 | pub value: Value,
10 | }
11 |
--------------------------------------------------------------------------------
/src/drivers/unified_gamepad/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod capability;
2 | pub mod driver;
3 | pub mod event;
4 | pub mod reports;
5 | pub mod value;
6 |
--------------------------------------------------------------------------------
/src/drivers/unified_gamepad/reports/input_capability_report_test.rs:
--------------------------------------------------------------------------------
1 | use std::error::Error;
2 |
3 | use crate::drivers::unified_gamepad::{
4 | capability::InputCapability,
5 | reports::{
6 | input_capability_report::{InputCapabilityInfo, InputCapabilityReport},
7 | ValueType,
8 | },
9 | };
10 |
11 | #[tokio::test]
12 | async fn test_packing() -> Result<(), Box> {
13 | let mut report = InputCapabilityReport::default();
14 | report
15 | .add_capability(InputCapabilityInfo::new(
16 | InputCapability::GamepadButtonStart,
17 | ValueType::Bool,
18 | ))
19 | .expect("should add capability");
20 | report
21 | .add_capability(InputCapabilityInfo::new(
22 | InputCapability::GamepadButtonSelect,
23 | ValueType::Bool,
24 | ))
25 | .expect("should add capability");
26 | report
27 | .get_capability(InputCapability::GamepadButtonSelect)
28 | .expect("should have added the capability");
29 |
30 | // Pack the report
31 | let bytes = report.pack_to_vec().expect("should pack to bytes");
32 | println!("Got bytes: {bytes:?}");
33 |
34 | // Unpack the report
35 | let unpacked_report =
36 | InputCapabilityReport::unpack(bytes.as_slice()).expect("should have unpacked");
37 |
38 | println!("Got unpacked report: {unpacked_report}");
39 |
40 | assert_eq!(
41 | format!("{report}"),
42 | format!("{unpacked_report}"),
43 | "unpacked report should match original"
44 | );
45 |
46 | Ok(())
47 | }
48 |
--------------------------------------------------------------------------------
/src/drivers/xpad_uhid/event.rs:
--------------------------------------------------------------------------------
1 | /// Events that can be emitted by the controller
2 | #[derive(Clone, Debug)]
3 | pub enum Event {
4 | Button(ButtonEvent),
5 | Axis(AxisEvent),
6 | Trigger(TriggerEvent),
7 | }
8 |
9 | /// Binary input contain either pressed or unpressed
10 | #[derive(Clone, Debug)]
11 | pub struct BinaryInput {
12 | pub pressed: bool,
13 | }
14 |
15 | /// Axis input contain (x, y) coordinates
16 | #[derive(Clone, Debug)]
17 | pub struct JoyAxisInput {
18 | pub x: u16,
19 | pub y: u16,
20 | }
21 |
22 | /// Trigger input contains non-negative integars
23 | #[derive(Clone, Debug)]
24 | pub struct TriggerInput {
25 | pub value: u16,
26 | }
27 |
28 | /// Button events represend binary inputs
29 | #[derive(Clone, Debug)]
30 | pub enum ButtonEvent {
31 | /// A Button
32 | A(BinaryInput),
33 | /// X Button
34 | X(BinaryInput),
35 | /// B Button
36 | B(BinaryInput),
37 | /// Y Button
38 | Y(BinaryInput),
39 | /// Right shoulder button
40 | RB(BinaryInput),
41 | /// Left shoulder button
42 | LB(BinaryInput),
43 | /// View ⧉ button
44 | View(BinaryInput),
45 | /// Menu (☰) button
46 | Menu(BinaryInput),
47 | /// Guide button
48 | Guide(BinaryInput),
49 | /// Z-axis button on the left stick
50 | ThumbL(BinaryInput),
51 | /// Z-axis button on the right stick
52 | ThumbR(BinaryInput),
53 | /// DPad up
54 | DPadUp(BinaryInput),
55 | /// DPad right
56 | DPadRight(BinaryInput),
57 | /// DPad down
58 | DPadDown(BinaryInput),
59 | /// DPad left
60 | DPadLeft(BinaryInput),
61 | }
62 |
63 | /// Axis events are events that have (x, y) values
64 | #[derive(Clone, Debug)]
65 | pub enum AxisEvent {
66 | LStick(JoyAxisInput),
67 | RStick(JoyAxisInput),
68 | }
69 |
70 | /// Trigger events contain values indicating how far a trigger is pulled
71 | #[derive(Clone, Debug)]
72 | pub enum TriggerEvent {
73 | TriggerL(TriggerInput),
74 | TriggerR(TriggerInput),
75 | }
76 |
--------------------------------------------------------------------------------
/src/drivers/xpad_uhid/hid_report_test.rs:
--------------------------------------------------------------------------------
1 | //use std::error::Error;
2 | //
3 | //use packed_struct::types::{Integer, SizedInteger};
4 | //
5 | //use crate::drivers::xpad_uhid::hid_report::DataReport;
6 | //
7 | //#[tokio::test]
8 | //async fn test_opi_hid() -> Result<(), Box> {
9 | // let mut report = DataReport::default();
10 | // println!("Before Report: {}", report);
11 | // report.l_stick_x = Integer::from_primitive(467);
12 | // report.r_stick_y = Integer::from_primitive(512);
13 | //
14 | // println!("After Report: {}", report);
15 | // assert_eq!(report.l_stick_x.to_primitive(), 467);
16 | // assert_eq!(report.r_stick_y.to_primitive(), 512);
17 | //
18 | // Ok(())
19 | //}
20 |
--------------------------------------------------------------------------------
/src/drivers/xpad_uhid/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver;
2 | pub mod event;
3 | pub mod hid_report;
4 | #[cfg(test)]
5 | pub mod hid_report_test;
6 |
--------------------------------------------------------------------------------
/src/drivers/zotac_zone/driver.rs:
--------------------------------------------------------------------------------
1 | use std::error::Error;
2 |
3 | use udev::Device;
4 |
5 | use crate::udev::device::{AttributeGetter, AttributeSetter, UdevDevice};
6 |
7 | // Hardware ID's
8 | const ZONE_PID: u16 = 0x1590;
9 | const ZONE_CFG_IF_NUM: i32 = 3;
10 | pub const PIDS: [u16; 1] = [ZONE_PID];
11 | pub const VID: u16 = 0x1ee9;
12 | pub const VID_ALT: u16 = 0x1e19;
13 | pub const VIDS: [u16; 2] = [VID, VID_ALT];
14 |
15 | pub struct Driver {
16 | _device: UdevDevice,
17 | }
18 |
19 | impl Driver {
20 | pub fn new(udevice: UdevDevice) -> Result> {
21 | let vid = udevice.id_vendor();
22 | let pid = udevice.id_product();
23 | if !VIDS.contains(&vid) || !PIDS.contains(&pid) {
24 | return Err(format!("'{}' is not an Zotac Zone controller", udevice.devnode()).into());
25 | }
26 |
27 | // Set the controller buttons to the correct values at startup
28 | let mut device = udevice.get_device()?;
29 | let Some(parent) = device.parent() else {
30 | return Err("Failed to get device parent".into());
31 | };
32 | let Some(driver) = parent.driver() else {
33 | return Err("Failed to identify device driver".into());
34 | };
35 | // Apply settings for the controller. Do error and crash IP as the
36 | // device is still usable.
37 | let drv_name = driver.to_str().unwrap();
38 | if drv_name == "zotac_zone_hid" || drv_name == "hid_zotac_zone" {
39 | if device.interface_number() == ZONE_CFG_IF_NUM {
40 | set_attribute(&mut device, "qam_mode", "0");
41 | set_attribute(&mut device, "btn_m2/remap/keyboard", "home");
42 | set_attribute(&mut device, "btn_m1/remap/keyboard", "end");
43 | }
44 | } else {
45 | return Err("Device is not using the zotac_zone driver.".into());
46 | }
47 |
48 | Ok(Self { _device: udevice })
49 | }
50 | }
51 |
52 | #[inline(always)]
53 | fn set_attribute(device: &mut Device, attribute: &str, value: &str) {
54 | match device.set_attribute_on_tree(attribute, value) {
55 | Ok(_) => log::debug!("set {attribute} to {value}"),
56 | Err(e) => log::error!("Could not set {attribute} to {value}: {e:?}"),
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/drivers/zotac_zone/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod driver;
2 |
--------------------------------------------------------------------------------
/src/generate.rs:
--------------------------------------------------------------------------------
1 | use std::fs::File;
2 | use std::io::Write;
3 |
4 | use inputplumber::config::capability_map::CapabilityMapConfigV2;
5 | use schemars::schema_for;
6 |
7 | fn main() {
8 | let composite_device_v2_schema = schema_for!(CapabilityMapConfigV2);
9 | let mut file = File::create("./rootfs/usr/share/inputplumber/schema/capability_map_v2.json")
10 | .expect("Failed to create schema file");
11 | write!(
12 | file,
13 | "{}",
14 | serde_json::to_string_pretty(&composite_device_v2_schema).unwrap()
15 | )
16 | .expect("Failed to write schema");
17 | }
18 |
--------------------------------------------------------------------------------
/src/iio/device.rs:
--------------------------------------------------------------------------------
1 | extern crate industrial_io as iio;
2 |
3 | #[derive(Debug, Clone)]
4 | pub struct Device {
5 | pub id: Option,
6 | pub name: Option,
7 | }
8 |
--------------------------------------------------------------------------------
/src/iio/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod device;
2 |
--------------------------------------------------------------------------------
/src/input/composite_device/command.rs:
--------------------------------------------------------------------------------
1 | use std::collections::{HashMap, HashSet};
2 |
3 | use tokio::sync::mpsc;
4 |
5 | use crate::{
6 | config::CompositeDeviceConfig,
7 | input::{
8 | capability::Capability,
9 | event::{native::NativeEvent, Event},
10 | output_event::OutputEvent,
11 | target::client::TargetDeviceClient,
12 | },
13 | udev::device::UdevDevice,
14 | };
15 |
16 | use super::InterceptMode;
17 |
18 | /// CompositeDevice commands define all the different ways to interact with [CompositeDevice]
19 | /// over a channel. These commands are processed in an asyncronous thread and
20 | /// dispatched as they come in.
21 | #[derive(Debug, Clone)]
22 | pub enum CompositeCommand {
23 | AttachTargetDevices(HashMap),
24 | GetConfig(mpsc::Sender),
25 | GetCapabilities(mpsc::Sender>),
26 | GetDBusDevicePaths(mpsc::Sender>),
27 | GetInterceptMode(mpsc::Sender),
28 | GetName(mpsc::Sender),
29 | GetProfileName(mpsc::Sender),
30 | GetSourceDevicePaths(mpsc::Sender>),
31 | GetTargetCapabilities(mpsc::Sender>),
32 | GetTargetDevicePaths(mpsc::Sender>),
33 | HandleEvent(NativeEvent),
34 | LoadProfileFromYaml(String, mpsc::Sender>),
35 | LoadProfilePath(String, mpsc::Sender>),
36 | ProcessEvent(String, Event),
37 | ProcessOutputEvent(OutputEvent),
38 | RemoveRecentEvent(Capability),
39 | SetInterceptActivation(Vec, Capability),
40 | SetInterceptMode(InterceptMode),
41 | SetTargetDevices(Vec),
42 | SourceDeviceAdded(UdevDevice),
43 | SourceDeviceRemoved(UdevDevice),
44 | SourceDeviceStopped(UdevDevice),
45 | UpdateSourceCapabilities(String, HashSet),
46 | UpdateTargetCapabilities(String, HashSet),
47 | WriteChordEvent(Vec),
48 | WriteEvent(NativeEvent),
49 | WriteSendEvent(NativeEvent),
50 | Stop,
51 | Suspend(mpsc::Sender<()>),
52 | Resume(mpsc::Sender<()>),
53 | IsSuspended(mpsc::Sender),
54 | }
55 |
--------------------------------------------------------------------------------
/src/input/event/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod dbus;
2 | pub mod evdev;
3 | pub mod native;
4 | pub mod value;
5 |
6 | /// Events are events that flow from source devices to target devices
7 | /// TODO: Remove this enum in favor of directly using NativeEvent
8 | #[derive(Debug, Clone)]
9 | pub enum Event {
10 | Native(native::NativeEvent),
11 | }
12 |
--------------------------------------------------------------------------------
/src/input/mod.rs:
--------------------------------------------------------------------------------
1 | //pub mod device;
2 | pub mod capability;
3 | pub mod composite_device;
4 | pub mod event;
5 | pub mod manager;
6 | pub mod output_capability;
7 | pub mod output_event;
8 | pub mod source;
9 | pub mod target;
10 |
--------------------------------------------------------------------------------
/src/input/output_capability.rs:
--------------------------------------------------------------------------------
1 | /// Output capabilities describe what kind of output events a source input device
2 | /// is capable of handling. E.g. Force Feedback, LED control, etc.
3 | #[derive(Clone, Debug, PartialEq, Eq, Hash)]
4 | pub enum OutputCapability {
5 | NotImplemented,
6 | ForceFeedback,
7 | ForceFeedbackUpload,
8 | ForceFeedbackErase,
9 | Haptics(Haptic),
10 | #[allow(clippy::upper_case_acronyms)]
11 | LED(LED),
12 | }
13 |
14 | /// LED capability
15 | #[allow(clippy::upper_case_acronyms)]
16 | #[derive(Clone, Debug, PartialEq, Eq, Hash)]
17 | pub enum LED {
18 | Brightness,
19 | Color,
20 | }
21 |
22 | /// Haptic capabilities
23 | #[derive(Clone, Debug, PartialEq, Eq, Hash)]
24 | pub enum Haptic {
25 | TrackpadLeft,
26 | TrackpadRight,
27 | //TrackpadCenter,
28 | }
29 |
--------------------------------------------------------------------------------
/src/input/source/command.rs:
--------------------------------------------------------------------------------
1 | use std::{error::Error, sync::mpsc::Sender};
2 |
3 | use evdev::FFEffectData;
4 |
5 | use crate::input::output_event::OutputEvent;
6 |
7 | /// A [SourceCommand] is a message that can be sent to a [SourceDevice] over
8 | /// a channel.
9 | #[derive(Debug, Clone)]
10 | pub enum SourceCommand {
11 | WriteEvent(OutputEvent),
12 | UploadEffect(
13 | FFEffectData,
14 | Sender>>,
15 | ),
16 | UpdateEffect(i16, FFEffectData),
17 | EraseEffect(i16, Sender>>),
18 | Stop,
19 | }
20 |
--------------------------------------------------------------------------------
/src/input/source/evdev/blocked.rs:
--------------------------------------------------------------------------------
1 | use std::{error::Error, fmt::Debug};
2 |
3 | use evdev::Device;
4 |
5 | use crate::{
6 | input::{
7 | capability::Capability,
8 | event::native::NativeEvent,
9 | source::{InputError, SourceInputDevice, SourceOutputDevice},
10 | },
11 | udev::device::UdevDevice,
12 | };
13 |
14 | /// Source device implementation to block evdev events
15 | pub struct BlockedEventDevice {
16 | device: Device,
17 | }
18 |
19 | impl BlockedEventDevice {
20 | /// Create a new [BlockedEventDevice] source device from the given udev info
21 | pub fn new(device_info: UdevDevice) -> Result> {
22 | let path = device_info.devnode();
23 | log::debug!("Opening device at: {}", path);
24 | let mut device = Device::open(path.clone())?;
25 | device.grab()?;
26 | log::info!("Blocking input events from {path}");
27 |
28 | Ok(Self { device })
29 | }
30 | }
31 |
32 | impl SourceInputDevice for BlockedEventDevice {
33 | fn poll(&mut self) -> Result, InputError> {
34 | Ok(vec![])
35 | }
36 |
37 | fn get_capabilities(&self) -> Result, InputError> {
38 | Ok(vec![])
39 | }
40 | }
41 |
42 | impl SourceOutputDevice for BlockedEventDevice {}
43 |
44 | impl Debug for BlockedEventDevice {
45 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
46 | f.debug_struct("BlockedEventDevice").finish()
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/input/source/hidraw/blocked.rs:
--------------------------------------------------------------------------------
1 | use std::{error::Error, fmt::Debug};
2 |
3 | use crate::{
4 | input::{
5 | capability::Capability,
6 | event::native::NativeEvent,
7 | source::{InputError, SourceInputDevice, SourceOutputDevice},
8 | },
9 | udev::device::UdevDevice,
10 | };
11 |
12 | /// Source device implementation to block hidraw events
13 | #[derive(Debug)]
14 | pub struct BlockedHidrawDevice {}
15 |
16 | impl BlockedHidrawDevice {
17 | /// Create a new [BlockedHidrawDevice] source device from the given udev info
18 | pub fn new(device_info: UdevDevice) -> Result> {
19 | let path = device_info.devnode();
20 | log::info!("Blocking input events from {path}");
21 |
22 | Ok(Self {})
23 | }
24 | }
25 |
26 | impl SourceInputDevice for BlockedHidrawDevice {
27 | fn poll(&mut self) -> Result, InputError> {
28 | Ok(vec![])
29 | }
30 |
31 | fn get_capabilities(&self) -> Result, InputError> {
32 | Ok(vec![])
33 | }
34 | }
35 |
36 | impl SourceOutputDevice for BlockedHidrawDevice {}
37 |
--------------------------------------------------------------------------------
/src/input/source/hidraw/dualshock4.rs:
--------------------------------------------------------------------------------
1 | //https://crates.io/crates/dualshock4
2 |
--------------------------------------------------------------------------------
/src/input/source/hidraw/legos_config.rs:
--------------------------------------------------------------------------------
1 | use std::{error::Error, fmt::Debug};
2 |
3 | use crate::{
4 | drivers::legos::config_driver::ConfigDriver,
5 | input::{
6 | capability::Capability,
7 | event::native::NativeEvent,
8 | source::{InputError, SourceInputDevice, SourceOutputDevice},
9 | },
10 | udev::device::UdevDevice,
11 | };
12 |
13 | /// XpadUhid source device implementation
14 | pub struct LegionSConfigController {
15 | _driver: ConfigDriver,
16 | }
17 |
18 | impl LegionSConfigController {
19 | /// Create a new source device with the given udev
20 | /// device information
21 | pub fn new(device_info: UdevDevice) -> Result> {
22 | let driver = ConfigDriver::new(device_info)?;
23 | Ok(Self { _driver: driver })
24 | }
25 | }
26 |
27 | impl Debug for LegionSConfigController {
28 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29 | f.debug_struct("LegionSConfig").finish()
30 | }
31 | }
32 | impl SourceInputDevice for LegionSConfigController {
33 | fn poll(&mut self) -> Result, InputError> {
34 | Ok(vec![])
35 | }
36 |
37 | fn get_capabilities(&self) -> Result, InputError> {
38 | Ok(vec![])
39 | }
40 | }
41 |
42 | impl SourceOutputDevice for LegionSConfigController {}
43 |
--------------------------------------------------------------------------------
/src/input/source/hidraw/msi_claw.rs:
--------------------------------------------------------------------------------
1 | use std::{error::Error, fmt::Debug};
2 |
3 | use crate::{
4 | drivers::msi_claw::{
5 | driver::Driver,
6 | hid_report::{GamepadMode, MkeysFunction},
7 | },
8 | input::{
9 | capability::Capability,
10 | event::native::NativeEvent,
11 | source::{InputError, SourceInputDevice, SourceOutputDevice},
12 | },
13 | udev::device::UdevDevice,
14 | };
15 |
16 | pub struct MsiClaw {
17 | driver: Driver,
18 | }
19 |
20 | impl MsiClaw {
21 | pub fn new(device_info: UdevDevice) -> Result> {
22 | let driver = Driver::new(device_info)?;
23 | log::debug!("Setting gamepad to XInput mode");
24 | driver.set_mode(GamepadMode::XInput, MkeysFunction::Macro)?;
25 | driver.set_mode(GamepadMode::XInput, MkeysFunction::Combination)?;
26 | driver.set_mode(GamepadMode::XInput, MkeysFunction::Macro)?;
27 | if let Err(e) = driver.get_mode() {
28 | log::error!("Failed to send get gamepad mode request: {e}");
29 | }
30 | Ok(Self { driver })
31 | }
32 | }
33 |
34 | impl Debug for MsiClaw {
35 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
36 | f.debug_struct("MsiClaw").finish()
37 | }
38 | }
39 | impl SourceInputDevice for MsiClaw {
40 | fn poll(&mut self) -> Result, InputError> {
41 | if let Err(e) = self.driver.poll() {
42 | log::error!("Error polling: {e}");
43 | }
44 | Ok(vec![])
45 | }
46 |
47 | fn get_capabilities(&self) -> Result, InputError> {
48 | Ok(vec![])
49 | }
50 | }
51 |
52 | impl SourceOutputDevice for MsiClaw {}
53 |
--------------------------------------------------------------------------------
/src/input/source/hidraw/rog_ally.rs:
--------------------------------------------------------------------------------
1 | use std::{error::Error, fmt::Debug};
2 |
3 | use crate::{
4 | drivers::rog_ally::driver::Driver,
5 | input::{
6 | capability::Capability,
7 | event::native::NativeEvent,
8 | source::{InputError, SourceInputDevice, SourceOutputDevice},
9 | },
10 | udev::device::UdevDevice,
11 | };
12 |
13 | /// XpadUhid source device implementation
14 | pub struct RogAlly {
15 | _driver: Driver,
16 | }
17 |
18 | impl RogAlly {
19 | /// Create a new source device with the given udev
20 | /// device information
21 | pub fn new(device_info: UdevDevice) -> Result> {
22 | let driver = Driver::new(device_info)?;
23 | Ok(Self { _driver: driver })
24 | }
25 | }
26 |
27 | impl Debug for RogAlly {
28 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29 | f.debug_struct("RogAlly").finish()
30 | }
31 | }
32 | impl SourceInputDevice for RogAlly {
33 | fn poll(&mut self) -> Result, InputError> {
34 | Ok(vec![])
35 | }
36 |
37 | fn get_capabilities(&self) -> Result, InputError> {
38 | Ok(vec![])
39 | }
40 | }
41 |
42 | impl SourceOutputDevice for RogAlly {}
43 |
--------------------------------------------------------------------------------
/src/input/source/hidraw/zotac_zone.rs:
--------------------------------------------------------------------------------
1 | use std::{error::Error, fmt::Debug};
2 |
3 | use crate::{
4 | drivers::zotac_zone::driver::Driver,
5 | input::{
6 | capability::Capability,
7 | event::native::NativeEvent,
8 | source::{InputError, SourceInputDevice, SourceOutputDevice},
9 | },
10 | udev::device::UdevDevice,
11 | };
12 |
13 | /// ZotacZone source device implementation
14 | pub struct ZotacZone {
15 | _driver: Driver,
16 | }
17 |
18 | impl ZotacZone {
19 | /// Create a new source device with the given udev device information
20 | pub fn new(device_info: UdevDevice) -> Result> {
21 | let driver = Driver::new(device_info)?;
22 | Ok(Self { _driver: driver })
23 | }
24 | }
25 |
26 | impl Debug for ZotacZone {
27 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28 | f.debug_struct("ZotacZone").finish()
29 | }
30 | }
31 |
32 | impl SourceInputDevice for ZotacZone {
33 | fn poll(&mut self) -> Result, InputError> {
34 | Ok(vec![])
35 | }
36 |
37 | fn get_capabilities(&self) -> Result, InputError> {
38 | Ok(vec![])
39 | }
40 | }
41 |
42 | impl SourceOutputDevice for ZotacZone {}
43 |
--------------------------------------------------------------------------------
/src/input/source/mod_test.rs:
--------------------------------------------------------------------------------
1 | use std::error::Error;
2 |
3 | use tokio::sync::mpsc::channel;
4 |
5 | use crate::{
6 | drivers::dualsense::driver::Driver,
7 | input::{
8 | composite_device::client::CompositeDeviceClient,
9 | event::{native::NativeEvent, Event},
10 | },
11 | };
12 |
13 | use super::{InputError, SourceDeviceService, SourceInputDevice, SourceOutputDevice};
14 |
15 | struct Test {
16 | driver: Driver,
17 | }
18 |
19 | impl Test {
20 | fn new() -> Self {
21 | let device_path = "/dev/hidraw0".to_string();
22 | let driver = Driver::new(device_path.clone()).unwrap();
23 | Self { driver }
24 | }
25 | }
26 |
27 | impl SourceInputDevice for Test {
28 | fn poll(&mut self) -> Result, InputError> {
29 | let events = self.driver.poll()?;
30 | let events = vec![];
31 | Ok(events)
32 | }
33 | }
34 |
35 | impl SourceOutputDevice for Test {}
36 |
37 | //#[tokio::test]
38 | async fn test_traits() -> Result<(), Box> {
39 | let (tx, rx) = channel(1024);
40 | let composite_dev = CompositeDeviceClient::new(tx);
41 | let test_device = Test::new();
42 |
43 | let device = SourceDeviceService::new(composite_dev, test_device);
44 |
45 | device.run().await?;
46 |
47 | Ok(())
48 | }
49 |
--------------------------------------------------------------------------------
/src/input/source/network.rs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ShadowBlip/InputPlumber/0c8aa23273157179e1b91152a78f614d70beedab/src/input/source/network.rs
--------------------------------------------------------------------------------
/src/input/target/command.rs:
--------------------------------------------------------------------------------
1 | use tokio::sync::mpsc::Sender;
2 |
3 | use crate::input::{
4 | capability::Capability, composite_device::client::CompositeDeviceClient,
5 | event::native::NativeEvent,
6 | };
7 |
8 | /// A [TargetCommand] is a message that can be sent to a [TargetDevice] over
9 | /// a channel.
10 | #[derive(Debug, Clone)]
11 | pub enum TargetCommand {
12 | /// Write the given event to the target device
13 | WriteEvent(NativeEvent),
14 | /// Set the given composite device on the target device
15 | SetCompositeDevice(CompositeDeviceClient),
16 | /// Return the input capabilities of the target device
17 | GetCapabilities(Sender>),
18 | /// Return the type of target input device
19 | GetType(Sender),
20 | /// Clear all local state on the target device
21 | ClearState,
22 | /// Stop the target device
23 | Stop,
24 | }
25 |
--------------------------------------------------------------------------------
/src/lib.rs:
--------------------------------------------------------------------------------
1 | pub mod bluetooth;
2 | pub mod cli;
3 | pub mod config;
4 | pub mod constants;
5 | pub mod dbus;
6 | pub mod dmi;
7 | pub mod drivers;
8 | pub mod iio;
9 | pub mod input;
10 | pub mod udev;
11 | pub mod watcher;
12 |
--------------------------------------------------------------------------------
/src/udev/device_test.rs:
--------------------------------------------------------------------------------
1 | use std::error::Error;
2 |
3 | use crate::udev::get_device;
4 |
5 | #[tokio::test]
6 | async fn test_get_device() -> Result<(), Box> {
7 | let path = "/dev/hidraw0";
8 | if let Ok(device) = get_device(path.to_string()).await {
9 | println!("Parsed device: {:?}", device);
10 | println!("Parent: {:?}", device.get_parent());
11 | println!("Parent name: {:?}", device.get_parent_device_name());
12 | println!("Vendor ID: {:?}", device.get_vendor_id());
13 | println!("Product ID: {:?}", device.get_product_id());
14 | }
15 |
16 | Ok(())
17 | }
18 |
--------------------------------------------------------------------------------