Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions rootfs/usr/lib/udev/hwdb.d/60-inputplumber-autostart.hwdb
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ dmi:*svnLENOVO:pn83Q3:*
dmi:*svnLENOVO:pn83N0:*
dmi:*svnLENOVO:pn83N1:*
# MSI Claw
dmi:*:svnMicro-StarInternationalCo.,Ltd.:pnClaw7AI+A2VM:*
dmi:*:svnMicro-StarInternationalCo.,Ltd.:pnClaw8AI+A2VM:*
dmi:*:svnMicro-StarInternationalCo.,Ltd.:pnClawA8BZ2EM:*
dmi:*:svnMicro-StarInternationalCo.,Ltd.:pnClawA1M:*
dmi:*:rvnMicro-StarInternationalCo.,Ltd.:rnMS-1T41:*
dmi:*:rvnMicro-StarInternationalCo.,Ltd.:rnMS-1T42:*
dmi:*:rvnMicro-StarInternationalCo.,Ltd.:rnMS-1T52:*
dmi:*:rvnMicro-StarInternationalCo.,Ltd.:rnMS-1T8K:*
dmi:*:rvnMicro-StarInternationalCo.,Ltd.:rnMS-1T91:*
# OneXPlayer Old models
dmi:*svnONE-NETBOOK:pnONEXPLAYER:*
dmi:*svnONE-NETBOOKTECHNOLOGYCO.,LTD.:pnONEXPLAYER:*
Expand Down
4 changes: 2 additions & 2 deletions rootfs/usr/share/inputplumber/devices/50-msi_claw7_a2vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ single_source: false
# /sys/class/dmi/id/product_name
matches:
- dmi_data:
product_name: "Claw 7 AI+ A2VM"
sys_vendor: "Micro-Star International Co., Ltd."
board_name: "MS-1T42"
board_vendor: "Micro-Star International Co., Ltd."

# One or more source devices to combine into a single virtual device. The events
# from these devices will be watched and translated according to the key map.
Expand Down
4 changes: 2 additions & 2 deletions rootfs/usr/share/inputplumber/devices/50-msi_claw8_a2vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ single_source: false
# /sys/class/dmi/id/product_name
matches:
- dmi_data:
product_name: "Claw 8 AI+ A2VM*"
sys_vendor: "Micro-Star International Co., Ltd."
board_name: "MS-1T52"
board_vendor: "Micro-Star International Co., Ltd."

# One or more source devices to combine into a single virtual device. The events
# from these devices will be watched and translated according to the key map.
Expand Down
143 changes: 143 additions & 0 deletions rootfs/usr/share/inputplumber/devices/50-msi_claw8_ex_ai_cg3em.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/composite_device_v1.json
# Schema version number
version: 1

# The type of configuration schema
kind: CompositeDevice

# Name of the composite device mapping
name: MSI Claw 8 EX AI+ CG3EM

# Only allow a single source device per composite device of this type.
single_source: false

# Only use this profile if *any* of the given matches match. If this list is
# empty, then the source devices will *always* be checked.
# /sys/class/dmi/id/product_name
matches:
- dmi_data:
board_name: "MS-1T91"
board_vendor: "Micro-Star International Co., Ltd."

# One or more source devices to combine into a single virtual device. The events
# from these devices will be watched and translated according to the key map.
source_devices:
# Face Extra Buttons
- group: keyboard
udev:
attributes:
- name: name
value: "AT Translated Set 2 keyboard"
- name: phys
value: "isa0060/serio0/input0"
events:
exclude:
- "*"
include:
- Keyboard:KeyF15
- Keyboard:KeyF16
- Keyboard:KeyG
- Keyboard:KeyLeftMeta
- Keyboard:KeyTab
- Keyboard:KeyVolumeDown
- Keyboard:KeyVolumeUp

# Conflicts, block
- group: keyboard
blocked: true
udev:
attributes:
- name: name
value: "MSI WMI hotkeys"
- name: phys
value: "wmi/input0"
events:
exclude:
- "*"

# Xinput Gamepad
- group: gamepad
udev:
properties:
- name: ID_INPUT_JOYSTICK
value: "1"
attributes:
- name: id/vendor
value: "0db0"
- name: id/product
value: "1901"
- name: phys
value: "usb-0000:00:14.0-4/input0"

# Xinput Mkey Extra Buttons
- group: gamepad
udev:
properties:
- name: ID_INPUT_KEYBOARD
value: "1"
attributes:
- name: id/vendor
value: "0db0"
- name: id/product
value: "1901"
- name: phys
value: "usb-0000:00:14.0-4/input2"
events:
exclude:
- "*"
include:
- Keyboard:KeyLeftBrace
- Keyboard:KeyRightBrace

# Dinput Gamepad
- group: gamepad
udev:
properties:
- name: ID_INPUT_JOYSTICK
value: "1"
attributes:
- name: id/vendor
value: "0db0"
- name: id/product
value: "1902"
- name: phys
value: "usb-0000:00:14.0-4/input0"
capability_map_id: claw1-dinput

# Dinput Mkey Extra Buttons
- group: gamepad
udev:
properties:
- name: ID_INPUT_KEYBOARD
value: "1"
attributes:
- name: id/vendor
value: "0db0"
- name: id/product
value: "1902"
- name: phys
value: "usb-0000:00:14.0-4/input1"
events:
exclude:
- "*"
include:
- Keyboard:KeyLeftBrace
- Keyboard:KeyRightBrace

# IMU

# Optional configuration for the composite device
options:
# If true, InputPlumber will automatically try to manage the input device. If
# this is false, InputPlumber will not try to manage the device unless an
# external service enables management of the device. Defaults to 'false'
auto_manage: true

# The target input device(s) to emulate by default
target_devices:
- xbox-elite
- mouse
- keyboard

# The ID of a device event mapping in the 'event_maps' folder
capability_map_id: claw1
4 changes: 2 additions & 2 deletions rootfs/usr/share/inputplumber/devices/50-msi_claw_a1m.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ single_source: false
# /sys/class/dmi/id/product_name
matches:
- dmi_data:
product_name: "Claw A1M"
sys_vendor: "Micro-Star International Co., Ltd."
board_name: "MS-1T41"
board_vendor: "Micro-Star International Co., Ltd."

# One or more source devices to combine into a single virtual device. The events
# from these devices will be watched and translated according to the key map.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ single_source: false
# /sys/class/dmi/id/product_name
matches:
- dmi_data:
product_name: "Claw A8 BZ2EM"
sys_vendor: "Micro-Star International Co., Ltd."
board_name: "MS-1T8K"
board_vendor: "Micro-Star International Co., Ltd."

# One or more source devices to combine into a single virtual device. The events
# from these devices will be watched and translated according to the key map.
Expand Down
5 changes: 5 additions & 0 deletions src/config/config_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ async fn check_autostart_rules() -> Result<(), Box<dyn Error>> {
let pattern_part = format!("pn{product}:");
patterns.push(pattern_part);
}
if let Some(board_vendor) = dmi.board_vendor.as_ref() {
let board_vendor = board_vendor.replace(" ", ""); // Remove spaces
let pattern_part = format!("rvn{board_vendor}:");
patterns.push(pattern_part);
}
if let Some(board_name) = dmi.board_name.as_ref() {
let board_name = board_name.replace(" ", ""); // Remove spaces
let pattern_part = format!("rn{board_name}:");
Expand Down
9 changes: 9 additions & 0 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ pub struct DMIMatch {
#[serde(skip_serializing_if = "Option::is_none")]
pub board_name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub board_vendor: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub product_name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub product_version: Option<String>,
Expand Down Expand Up @@ -1082,6 +1084,13 @@ impl CompositeDeviceConfig {
has_matches = true;
}

if let Some(board_vendor) = dmi_config.board_vendor {
if !glob_match(board_vendor.as_str(), data.board_vendor.as_str()) {
continue;
}
has_matches = true;
}

if let Some(product_name) = dmi_config.product_name {
if !glob_match(product_name.as_str(), data.product_name.as_str()) {
continue;
Expand Down
Loading