diff --git a/rootfs/usr/share/inputplumber/capability_maps/flydigi_vader_4_pro.yaml b/rootfs/usr/share/inputplumber/capability_maps/flydigi_vader_4_pro.yaml new file mode 100644 index 00000000..92bd9e18 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/flydigi_vader_4_pro.yaml @@ -0,0 +1,68 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v1.json +# Schema version number +version: 1 +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: flydigi-vader-4-pro + +# Unique identifier of the capability mapping +id: flydigi-vader-4-pro + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: LeftPaddle1 + source_events: + - gamepad: + button: RightPaddle3 + target_event: + gamepad: + button: LeftPaddle1 + - name: LeftPaddle2 + source_events: + - gamepad: + button: LeftPaddle3 + target_event: + gamepad: + button: LeftPaddle2 + - name: RightPaddle1 + source_events: + - gamepad: + button: RightPaddle2 + target_event: + gamepad: + button: RightPaddle1 + - name: RightPaddle2 + source_events: + - gamepad: + button: RightPaddle1 + target_event: + gamepad: + button: RightPaddle2 + - name: LeftPaddle3 + source_events: + - gamepad: + button: LeftPaddle1 + target_event: + touchpad: + name: LeftPad + touch: + button: Touch + motion: + region: top-left + speed_pps: 800 + - name: RightPaddle3 + source_events: + - gamepad: + button: LeftPaddle2 + target_event: + touchpad: + name: RightPad + touch: + button: Touch + motion: + region: top-left + speed_pps: 800 +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/devices/60-flydigi_vader_4_pro.yaml b/rootfs/usr/share/inputplumber/devices/60-flydigi_vader_4_pro.yaml new file mode 100644 index 00000000..6432e563 --- /dev/null +++ b/rootfs/usr/share/inputplumber/devices/60-flydigi_vader_4_pro.yaml @@ -0,0 +1,38 @@ +# 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: flydigi-vader-4-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: [] + +# Only allow a single source device per composite device of this type. +maximum_sources: 1 + +# 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: gamepad + udev: + properties: + - name: ID_MODEL + value: "Flydigi_VADER4" + sys_name: "event*" + subsystem: input + +# The target input device(s) that the virtual device profile can use +target_devices: + - deck + - touchpad + +capability_map_id: flydigi-vader-4-pro + +options: + auto_manage: true diff --git a/src/input/event/evdev.rs b/src/input/event/evdev.rs index ede50f53..1eaaa66d 100644 --- a/src/input/event/evdev.rs +++ b/src/input/event/evdev.rs @@ -166,6 +166,9 @@ impl EvdevEvent { KeyCode::BTN_TRIGGER_HAPPY8 => Capability::Gamepad(Gamepad::Button(GamepadButton::LeftPaddle2)), KeyCode::BTN_TRIGGER_HAPPY9 => Capability::Gamepad(Gamepad::Button(GamepadButton::RightPaddle3)), KeyCode::BTN_TRIGGER_HAPPY10 => Capability::Gamepad(Gamepad::Button(GamepadButton::LeftPaddle3)), + KeyCode::BTN_TRIGGER_HAPPY11 => Capability::Gamepad(Gamepad::Button(GamepadButton::RightPaddle1)), + KeyCode::BTN_TRIGGER_HAPPY12 => Capability::Gamepad(Gamepad::Button(GamepadButton::RightPaddle2)), + KeyCode::BTN_TRIGGER_HAPPY13 => Capability::Gamepad(Gamepad::Button(GamepadButton::QuickAccess)), KeyCode::BTN_THUMBL => { Capability::Gamepad(Gamepad::Button(GamepadButton::LeftStick)) }