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
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ log = { version = "0.4.29", features = [
] }
mio = { version = "1.1.1", features = ["os-poll", "os-ext", "net"] }
nix = { version = "0.30.1", features = ["fs"] }
num_enum = "0.7.6"
packed_struct = "0.10.1"
procfs = "0.18.0"
rand = "0.9.2"
Expand Down
67 changes: 67 additions & 0 deletions rootfs/usr/share/inputplumber/devices/50-razer_tartarus_pro.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 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: Razer Tartarus Pro

# Only use this profile if *any* of the given matches matches. If this list is
# empty,then the source devices will *always* be checked.
# /sys/class/dmi/id/product_name
matches: []

# Maximum number of source devices per CompositeDevice.
maximum_sources: 7

# 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:
- group: keyboard
blocked: true
unique: false
evdev:
name: "Razer Razer Tartarus Pro*"
handler: event*
- group: keyboard
unique: false
hidraw:
vendor_id: 0x1532
product_id: 0x244
interface_num: 0
- group: keyboard
unique: false
hidraw:
vendor_id: 0x1532
product_id: 0x244
interface_num: 1
config:
analogkeys:
primary_actuation:
# 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
keys: [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a huge fan of this array to be honest. I think it is going to be too difficult to manually edit for anyone who didn't write the code. IMU configs are already difficult enough and that's just 9 values and they are shared among many devices.

Perhaps you could have default values that are overridden by a config.
Then add these fields as optional field, each as an indexed named entry that matches the capabilities for each key & activation level.

Maybe there is a better way than that as well. I'd like to get @ShadowApex opinion on it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to options, this first iteration seemed the most straight forward to me at the time as I couldn't find a way to get a profile setting to work its way through to a backing source device, it all seemed to terminate at the composite device. I'll revisit this later on in the week.

secondary_actuation:
keys: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
retrigger_reset_threshold:
keys: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
retrigger_trigger_threshold:
keys: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
continuous_retrigger:
keys: ["N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N"]
- group: mouse
unique: false
passthrough: true
hidraw:
vendor_id: 0x1532
product_id: 0x244
interface_num: 2

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

options:
auto_manage: true
135 changes: 135 additions & 0 deletions rootfs/usr/share/inputplumber/profiles/secondary_rebind.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/device_profile_v1.json
# Schema version number
version: 1

# The type of configuration schema
kind: DeviceProfile

# Name of the device profile
name: Tartarus Pro Secondary Actuation Rebind

# Description of the device profile
description: Rebinding profile for the Tartarus Pro which generates phantom keypresses during second actuation

# Profile mappings
mapping:
# Phantom keys generated by secondary actuation
- name: Phantom-1
source_event:
keyboard: KeyB
target_events:
- keyboard: KeyB

- name: Phantom-2
source_event:
keyboard: KeyG
target_events:
- keyboard: KeyG

- name: Phantom-3
source_event:
keyboard: KeyH
target_events:
- keyboard: KeyH

- name: Phantom-4
source_event:
keyboard: KeyI
target_events:
- keyboard: KeyI

- name: Phantom-5
source_event:
keyboard: KeyJ
target_events:
- keyboard: KeyJ

- name: Phantom-6
source_event:
keyboard: KeyK
target_events:
- keyboard: KeyK

- name: Phantom-7
source_event:
keyboard: KeyL
target_events:
- keyboard: KeyL

- name: Phantom-8
source_event:
keyboard: KeyM
target_events:
- keyboard: KeyM

- name: Phantom-9
source_event:
keyboard: KeyN
target_events:
- keyboard: KeyN

- name: Phantom-10
source_event:
keyboard: KeyO
target_events:
- keyboard: KeyO

- name: Phantom-11
source_event:
keyboard: KeyP
target_events:
- keyboard: KeyP

- name: Phantom-12
source_event:
keyboard: KeyT
target_events:
- keyboard: KeyT

- name: Phantom-13
source_event:
keyboard: KeyU
target_events:
- keyboard: KeyU

- name: Phantom-14
source_event:
keyboard: KeyV
target_events:
- keyboard: KeyV

- name: Phantom-15
source_event:
keyboard: KeyY
target_events:
- keyboard: KeyY

- name: Phantom-16
source_event:
keyboard: Key6
target_events:
- keyboard: Key6

- name: Phantom-17
source_event:
keyboard: Key7
target_events:
- keyboard: Key7

- name: Phantom-18
source_event:
keyboard: Key8
target_events:
- keyboard: Key8

- name: Phantom-19
source_event:
keyboard: Key9
target_events:
- keyboard: Key9

- name: Phantom-20
source_event:
keyboard: Key0
target_events:
- keyboard: Key0
121 changes: 120 additions & 1 deletion rootfs/usr/share/inputplumber/schema/composite_device_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@
},
"led": {
"$ref": "#/definitions/LedConfig"
},
"analogkeys": {
"$ref": "#/definitions/AnalogKeysConfig"
}
}
},
Expand Down Expand Up @@ -285,6 +288,27 @@
}
}
},
"AnalogKeysConfig":{
"type": "object",
"additionalProperties": false,
"properties": {
"primary_actuation": {
"$ref": "#/definitions/PrimaryActuation"
},
"secondary_actuation": {
"$ref": "#/definitions/SecondaryActuation"
},
"retrigger_reset_threshold": {
"$ref": "#/definitions/RetriggerResetThreshold"
},
"retrigger_trigger_threshold": {
"$ref": "#/definitions/RetriggerTriggerThreshold"
},
"continuous_retrigger": {
"$ref": "#/definitions/ContinuousRetrigger"
}
}
},
"Udev": {
"description": "Source device to manage. Properties support globbing patterns.",
"type": "object",
Expand Down Expand Up @@ -511,6 +535,101 @@
"type": "number"
}
}
}
},
"PrimaryActuation": {
"type": "object",
"description": "Depth value for actuation of first keybind. Limit between 1.4 to 3.6mm in 0.1mm steps",
"additionalProperties": false,
"properties": {
"keys": {
"description": "Matrix of keys storing the property value",
"type": "array",
"minItems": 20,
"maxItems": 20,
"items": {
"type": "number"
}
}
},
"required": [
"keys",
]
},
"SecondaryActuation": {
"type": "object",
"description": "Depth value for actuation of second keybind. Limit between 1.4 to 3.6mm in 0.1mm steps",
"additionalProperties": false,
"properties": {
"keys": {
"description": "Matrix of keys storing the property value",
"type": "array",
"minItems": 20,
"maxItems": 20,
"items": {
"type": "number"
}
}
},
"required": [
"keys",
]
},
"RetriggerResetThreshold": {
"type": "object",
"description": "Distance in mm which resets a key. Limit between 0 to 2.1mm in 0.1mm steps",
"additionalProperties": false,
"properties": {
"keys": {
"description": "Matrix of keys storing the property value",
"type": "array",
"minItems": 20,
"maxItems": 20,
"items": {
"type": "number"
}
}
},
"required": [
"keys",
]
},
"RetriggerTriggerThreshold": {
"type": "object",
"description": "Optional distance in mm which triggers a key after reset. Limit between 0 to 2.1mm in 0.1mm steps",
"additionalProperties": false,
"properties": {
"keys": {
"description": "Matrix of keys storing the property value",
"type": "array",
"minItems": 20,
"maxItems": 20,
"items": {
"type": "number"
}
}
},
"required": [
"keys",
]
},
"ContinuousRetrigger": {
"type": "object",
"description": "Enable continuous retrigger for a key, set 'Y' or 'y' to enable, all else will disable",
"additionalProperties": false,
"properties": {
"keys": {
"description": "Matrix of keys storing the property value",
"type": "array",
"minItems": 20,
"maxItems": 20,
"items": {
"type": "string"
}
}
},
"required": [
"keys",
]
},
}
}
Loading