Skip to content

Commit e8857c7

Browse files
matte-schwartzpastaq
authored andcommitted
feat(Hardware Support): Add MSI Claw 8 EX AI+ profile
Also fix all the Claws to use board_name, like we do everywhere else.
1 parent 9f229fd commit e8857c7

10 files changed

Lines changed: 180 additions & 12 deletions

File tree

rootfs/usr/lib/udev/hwdb.d/60-inputplumber-autostart.hwdb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ dmi:*svnLENOVO:pn83Q3:*
7777
dmi:*svnLENOVO:pn83N0:*
7878
dmi:*svnLENOVO:pn83N1:*
7979
# MSI Claw
80-
dmi:*:svnMicro-StarInternationalCo.,Ltd.:pnClaw7AI+A2VM:*
81-
dmi:*:svnMicro-StarInternationalCo.,Ltd.:pnClaw8AI+A2VM:*
82-
dmi:*:svnMicro-StarInternationalCo.,Ltd.:pnClawA8BZ2EM:*
83-
dmi:*:svnMicro-StarInternationalCo.,Ltd.:pnClawA1M:*
80+
dmi:*:rvnMicro-StarInternationalCo.,Ltd.:rnMS-1T41:*
81+
dmi:*:rvnMicro-StarInternationalCo.,Ltd.:rnMS-1T42:*
82+
dmi:*:rvnMicro-StarInternationalCo.,Ltd.:rnMS-1T52:*
83+
dmi:*:rvnMicro-StarInternationalCo.,Ltd.:rnMS-1T8K:*
84+
dmi:*:rvnMicro-StarInternationalCo.,Ltd.:rnMS-1T91:*
8485
# OneXPlayer Old models
8586
dmi:*svnONE-NETBOOK:pnONEXPLAYER:*
8687
dmi:*svnONE-NETBOOKTECHNOLOGYCO.,LTD.:pnONEXPLAYER:*

rootfs/usr/share/inputplumber/devices/50-msi_claw7_a2vm.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ single_source: false
1616
# /sys/class/dmi/id/product_name
1717
matches:
1818
- dmi_data:
19-
product_name: "Claw 7 AI+ A2VM"
20-
sys_vendor: "Micro-Star International Co., Ltd."
19+
board_name: "MS-1T42"
20+
board_vendor: "Micro-Star International Co., Ltd."
2121

2222
# One or more source devices to combine into a single virtual device. The events
2323
# from these devices will be watched and translated according to the key map.

rootfs/usr/share/inputplumber/devices/50-msi_claw8_a2vm.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ single_source: false
1616
# /sys/class/dmi/id/product_name
1717
matches:
1818
- dmi_data:
19-
product_name: "Claw 8 AI+ A2VM*"
20-
sys_vendor: "Micro-Star International Co., Ltd."
19+
board_name: "MS-1T52"
20+
board_vendor: "Micro-Star International Co., Ltd."
2121

2222
# One or more source devices to combine into a single virtual device. The events
2323
# from these devices will be watched and translated according to the key map.
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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 EX AI+ CG3EM
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+
board_name: "MS-1T91"
20+
board_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+
# Face Extra Buttons
26+
- group: keyboard
27+
udev:
28+
attributes:
29+
- name: name
30+
value: "AT Translated Set 2 keyboard"
31+
- name: phys
32+
value: "isa0060/serio0/input0"
33+
events:
34+
exclude:
35+
- "*"
36+
include:
37+
- Keyboard:KeyF15
38+
- Keyboard:KeyF16
39+
- Keyboard:KeyG
40+
- Keyboard:KeyLeftMeta
41+
- Keyboard:KeyTab
42+
- Keyboard:KeyVolumeDown
43+
- Keyboard:KeyVolumeUp
44+
45+
# Conflicts, block
46+
- group: keyboard
47+
blocked: true
48+
udev:
49+
attributes:
50+
- name: name
51+
value: "MSI WMI hotkeys"
52+
- name: phys
53+
value: "wmi/input0"
54+
events:
55+
exclude:
56+
- "*"
57+
58+
# Xinput Gamepad
59+
- group: gamepad
60+
udev:
61+
properties:
62+
- name: ID_INPUT_JOYSTICK
63+
value: "1"
64+
attributes:
65+
- name: id/vendor
66+
value: "0db0"
67+
- name: id/product
68+
value: "1901"
69+
- name: phys
70+
value: "usb-0000:00:14.0-4/input0"
71+
72+
# Xinput Mkey Extra Buttons
73+
- group: gamepad
74+
udev:
75+
properties:
76+
- name: ID_INPUT_KEYBOARD
77+
value: "1"
78+
attributes:
79+
- name: id/vendor
80+
value: "0db0"
81+
- name: id/product
82+
value: "1901"
83+
- name: phys
84+
value: "usb-0000:00:14.0-4/input2"
85+
events:
86+
exclude:
87+
- "*"
88+
include:
89+
- Keyboard:KeyLeftBrace
90+
- Keyboard:KeyRightBrace
91+
92+
# Dinput Gamepad
93+
- group: gamepad
94+
udev:
95+
properties:
96+
- name: ID_INPUT_JOYSTICK
97+
value: "1"
98+
attributes:
99+
- name: id/vendor
100+
value: "0db0"
101+
- name: id/product
102+
value: "1902"
103+
- name: phys
104+
value: "usb-0000:00:14.0-4/input0"
105+
capability_map_id: claw1-dinput
106+
107+
# Dinput Mkey Extra Buttons
108+
- group: gamepad
109+
udev:
110+
properties:
111+
- name: ID_INPUT_KEYBOARD
112+
value: "1"
113+
attributes:
114+
- name: id/vendor
115+
value: "0db0"
116+
- name: id/product
117+
value: "1902"
118+
- name: phys
119+
value: "usb-0000:00:14.0-4/input1"
120+
events:
121+
exclude:
122+
- "*"
123+
include:
124+
- Keyboard:KeyLeftBrace
125+
- Keyboard:KeyRightBrace
126+
127+
# IMU
128+
129+
# Optional configuration for the composite device
130+
options:
131+
# If true, InputPlumber will automatically try to manage the input device. If
132+
# this is false, InputPlumber will not try to manage the device unless an
133+
# external service enables management of the device. Defaults to 'false'
134+
auto_manage: true
135+
136+
# The target input device(s) to emulate by default
137+
target_devices:
138+
- xbox-elite
139+
- mouse
140+
- keyboard
141+
142+
# The ID of a device event mapping in the 'event_maps' folder
143+
capability_map_id: claw1

rootfs/usr/share/inputplumber/devices/50-msi_claw_a1m.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ single_source: false
1616
# /sys/class/dmi/id/product_name
1717
matches:
1818
- dmi_data:
19-
product_name: "Claw A1M"
20-
sys_vendor: "Micro-Star International Co., Ltd."
19+
board_name: "MS-1T41"
20+
board_vendor: "Micro-Star International Co., Ltd."
2121

2222
# One or more source devices to combine into a single virtual device. The events
2323
# from these devices will be watched and translated according to the key map.

rootfs/usr/share/inputplumber/devices/50-msi_claw_a8_bz2e.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ single_source: false
1616
# /sys/class/dmi/id/product_name
1717
matches:
1818
- dmi_data:
19-
product_name: "Claw A8 BZ2EM"
20-
sys_vendor: "Micro-Star International Co., Ltd."
19+
board_name: "MS-1T8K"
20+
board_vendor: "Micro-Star International Co., Ltd."
2121

2222
# One or more source devices to combine into a single virtual device. The events
2323
# from these devices will be watched and translated according to the key map.

src/config/config_test.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ async fn check_autostart_rules() -> Result<(), Box<dyn Error>> {
7171
let pattern_part = format!("pn{product}:");
7272
patterns.push(pattern_part);
7373
}
74+
if let Some(board_vendor) = dmi.board_vendor.as_ref() {
75+
let board_vendor = board_vendor.replace(" ", ""); // Remove spaces
76+
let pattern_part = format!("rvn{board_vendor}:");
77+
patterns.push(pattern_part);
78+
}
7479
if let Some(board_name) = dmi.board_name.as_ref() {
7580
let board_name = board_name.replace(" ", ""); // Remove spaces
7681
let pattern_part = format!("rn{board_name}:");

src/config/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ pub struct DMIMatch {
212212
#[serde(skip_serializing_if = "Option::is_none")]
213213
pub board_name: Option<String>,
214214
#[serde(skip_serializing_if = "Option::is_none")]
215+
pub board_vendor: Option<String>,
216+
#[serde(skip_serializing_if = "Option::is_none")]
215217
pub product_name: Option<String>,
216218
#[serde(skip_serializing_if = "Option::is_none")]
217219
pub product_version: Option<String>,
@@ -1082,6 +1084,13 @@ impl CompositeDeviceConfig {
10821084
has_matches = true;
10831085
}
10841086

1087+
if let Some(board_vendor) = dmi_config.board_vendor {
1088+
if !glob_match(board_vendor.as_str(), data.board_vendor.as_str()) {
1089+
continue;
1090+
}
1091+
has_matches = true;
1092+
}
1093+
10851094
if let Some(product_name) = dmi_config.product_name {
10861095
if !glob_match(product_name.as_str(), data.product_name.as_str()) {
10871096
continue;

src/input/target/steam_deck.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,11 @@ impl TargetInputDevice for SteamDeckDevice {
890890
device_config.name = "Claw Controller".to_string();
891891
device_config.product_id = ProductId::MsiClaw;
892892
}
893+
"MSI Claw 8 EX AI+ CG3EM" => {
894+
device_config.vendor = "MSI".to_string();
895+
device_config.name = "Claw Controller".to_string();
896+
device_config.product_id = ProductId::MsiClaw;
897+
}
893898
"MSI Claw A8 BZ2EM" => {
894899
device_config.vendor = "MSI".to_string();
895900
device_config.name = "Claw Controller".to_string();

src/input/target/steam_deck_uhid.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,11 @@ impl TargetInputDevice for SteamDeckUhidDevice {
698698
device_config.name = "Claw Controller".to_string();
699699
device_config.product_id = ProductId::MsiClaw;
700700
}
701+
"MSI Claw 8 EX AI+ CG3EM" => {
702+
device_config.vendor = "MSI".to_string();
703+
device_config.name = "Claw Controller".to_string();
704+
device_config.product_id = ProductId::MsiClaw;
705+
}
701706
"MSI Claw A8 BZ2EM" => {
702707
device_config.vendor = "MSI".to_string();
703708
device_config.name = "Claw Controller".to_string();

0 commit comments

Comments
 (0)