From 00491ae0242cc08989b1fc14441c8be336f17ccd Mon Sep 17 00:00:00 2001 From: "Derek J. Clark" Date: Wed, 13 Mar 2024 17:54:45 -0700 Subject: [PATCH] feat(composite_device): Add all HandyGCCS supported devices. --- Cargo.lock | 2 +- .../capability_maps/ally_type1.yaml | 70 +++++++++++++++++++ .../capability_maps/anbernic_type1.yaml | 46 ++++++++++++ .../capability_maps/ayaneo_type1.yaml | 47 +++++++++++++ .../capability_maps/ayaneo_type2.yaml | 48 +++++++++++++ .../capability_maps/ayaneo_type3.yaml | 49 +++++++++++++ .../capability_maps/ayaneo_type4.yaml | 49 +++++++++++++ .../capability_maps/ayaneo_type5.yaml | 49 +++++++++++++ .../capability_maps/ayaneo_type6.yaml | 57 +++++++++++++++ .../capability_maps/ayn_type1.yaml | 33 +++++++++ .../capability_maps/gpd_type1.yaml | 32 +++++++++ .../capability_maps/gpd_type2.yaml | 30 ++++++++ .../capability_maps/gpd_type3.yaml | 30 ++++++++ .../capability_maps/onexplayer_type1.yaml | 48 +++++++++++++ .../capability_maps/onexplayer_type2.yaml | 55 +++++++++++++++ .../capability_maps/onexplayer_type4.yaml | 39 +++++++++++ .../{win_600.yaml => 50-anbernic_win600.yaml} | 4 +- .../{aokzoe_a1.yaml => 50-aokzoe_a1.yaml} | 2 +- .../{ayaneo_2.yaml => 50-ayaneo_2.yaml} | 2 +- .../{ayaneo_2021.yaml => 50-ayaneo_2021.yaml} | 2 +- .../{ayaneo_2s.yaml => 50-ayaneo_2s.yaml} | 2 +- .../{ayaneo_air.yaml => 50-ayaneo_air.yaml} | 2 +- ..._air_plus.yaml => 50-ayaneo_air_plus.yaml} | 2 +- .../{ayaneo_kun.yaml => 50-ayaneo_kun.yaml} | 4 +- .../{ayaneo_next.yaml => 50-ayaneo_next.yaml} | 2 +- ...ayaneo_slide.yaml => 50-ayaneo_slide.yaml} | 2 +- .../{ayn_loki.yaml => 50-ayn_loki.yaml} | 2 +- .../{gpd_win3.yaml => 50-gpd_win3.yaml} | 2 +- .../{gpd_win4.yaml => 50-gpd_win4.yaml} | 2 +- .../{gpd_winmax2.yaml => 50-gpd_winmax2.yaml} | 2 +- .../{gpd_winmini.yaml => 50-gpd_winmini.yaml} | 2 +- ...onexplayer_2.yaml => 50-onexplayer_2.yaml} | 2 +- .../devices/50-onexplayer_intel.yaml | 2 +- ...i_pro.yaml => 50-onexplayer_mini_pro.yaml} | 2 +- ...nexfly.yaml => 50-onexplayer_onexfly.yaml} | 2 +- .../inputplumber/devices/50-rog_ally.yaml | 39 +++++++++++ .../{anbernic_win600.yaml => 50-win_600.yaml} | 2 +- .../share/inputplumber/devices/rog_ally.yaml | 66 ----------------- .../schema/capability_map_v1.json | 3 +- src/input/capability.rs | 3 + src/input/event/dbus.rs | 1 + src/input/event/evdev.rs | 3 +- src/input/target/keyboard.rs | 2 + 43 files changed, 754 insertions(+), 91 deletions(-) create mode 100644 rootfs/usr/share/inputplumber/capability_maps/ally_type1.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/anbernic_type1.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/ayaneo_type1.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/ayaneo_type2.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/ayaneo_type3.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/ayaneo_type4.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/ayaneo_type5.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/ayaneo_type6.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/ayn_type1.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/gpd_type1.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/gpd_type2.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/gpd_type3.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/onexplayer_type1.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/onexplayer_type2.yaml create mode 100644 rootfs/usr/share/inputplumber/capability_maps/onexplayer_type4.yaml rename rootfs/usr/share/inputplumber/devices/{win_600.yaml => 50-anbernic_win600.yaml} (95%) rename rootfs/usr/share/inputplumber/devices/{aokzoe_a1.yaml => 50-aokzoe_a1.yaml} (98%) rename rootfs/usr/share/inputplumber/devices/{ayaneo_2.yaml => 50-ayaneo_2.yaml} (97%) rename rootfs/usr/share/inputplumber/devices/{ayaneo_2021.yaml => 50-ayaneo_2021.yaml} (98%) rename rootfs/usr/share/inputplumber/devices/{ayaneo_2s.yaml => 50-ayaneo_2s.yaml} (98%) rename rootfs/usr/share/inputplumber/devices/{ayaneo_air.yaml => 50-ayaneo_air.yaml} (97%) rename rootfs/usr/share/inputplumber/devices/{ayaneo_air_plus.yaml => 50-ayaneo_air_plus.yaml} (98%) rename rootfs/usr/share/inputplumber/devices/{ayaneo_kun.yaml => 50-ayaneo_kun.yaml} (97%) rename rootfs/usr/share/inputplumber/devices/{ayaneo_next.yaml => 50-ayaneo_next.yaml} (98%) rename rootfs/usr/share/inputplumber/devices/{ayaneo_slide.yaml => 50-ayaneo_slide.yaml} (97%) rename rootfs/usr/share/inputplumber/devices/{ayn_loki.yaml => 50-ayn_loki.yaml} (98%) rename rootfs/usr/share/inputplumber/devices/{gpd_win3.yaml => 50-gpd_win3.yaml} (97%) rename rootfs/usr/share/inputplumber/devices/{gpd_win4.yaml => 50-gpd_win4.yaml} (97%) rename rootfs/usr/share/inputplumber/devices/{gpd_winmax2.yaml => 50-gpd_winmax2.yaml} (97%) rename rootfs/usr/share/inputplumber/devices/{gpd_winmini.yaml => 50-gpd_winmini.yaml} (97%) rename rootfs/usr/share/inputplumber/devices/{onexplayer_2.yaml => 50-onexplayer_2.yaml} (98%) rename rootfs/usr/share/inputplumber/devices/{onexplayer_mini_pro.yaml => 50-onexplayer_mini_pro.yaml} (97%) rename rootfs/usr/share/inputplumber/devices/{onexplayer_onexfly.yaml => 50-onexplayer_onexfly.yaml} (97%) create mode 100644 rootfs/usr/share/inputplumber/devices/50-rog_ally.yaml rename rootfs/usr/share/inputplumber/devices/{anbernic_win600.yaml => 50-win_600.yaml} (97%) delete mode 100644 rootfs/usr/share/inputplumber/devices/rog_ally.yaml diff --git a/Cargo.lock b/Cargo.lock index 027f5faf..4a23b2a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -667,7 +667,7 @@ dependencies = [ [[package]] name = "inputplumber" -version = "0.7.2" +version = "0.7.3" dependencies = [ "env_logger", "evdev", diff --git a/rootfs/usr/share/inputplumber/capability_maps/ally_type1.yaml b/rootfs/usr/share/inputplumber/capability_maps/ally_type1.yaml new file mode 100644 index 00000000..f55aae2f --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/ally_type1.yaml @@ -0,0 +1,70 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: Ally Type 1 + +# Unique identifier of the capability mapping +id: aly1 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + #- name: Select + # source_events: + # - gamepad: + # button: Select + # target_event: + # gamepad: + # button: Guide + #- name: Start + # source_events: + # - gamepad: + # button: Start + # target_event: + # gamepad: + # button: QuickAccess + - name: Control Center (Short) + source_events: + - keyboard: KeyF16 + target_event: + gamepad: + button: Guide #Select + - name: Control Center (Long) + source_events: + - keyboard: KeyLeftCtrl + - keyboard: KeyLeftAlt + - keyboard: KeyDelete + target_event: + gamepad: + button: Guide # TODO: Add a more specific button + - name: Armory Crate (Short) + source_events: + - keyboard: KeyProg1 + target_event: + gamepad: + button: QuickAccess #Start + - name: Armory Crate (Long) + source_events: + - keyboard: KeyF17 + target_event: + gamepad: + button: QuickAccess2 + - name: Left Paddle + source_events: + - keyboard: KeyF14 + target_event: + gamepad: + button: LeftPaddle1 + - name: Right Paddle + source_events: + - keyboard: KeyF15 + target_event: + gamepad: + button: RightPaddle1 + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/anbernic_type1.yaml b/rootfs/usr/share/inputplumber/capability_maps/anbernic_type1.yaml new file mode 100644 index 00000000..0fcfa0a2 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/anbernic_type1.yaml @@ -0,0 +1,46 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: Anbernic Type 1 + +# Unique identifier of the capability mapping +id: anb1 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + #TODO: Figure out how to use this and also Windows, Keyboard. + #- name: Home (Short Press) + # source_events: + # - keyboard: KeyLeftMeta + # target_event: + # gamepad: + # button: QuickAccess2 + - name: Home (Long Press) + source_events: + - keyboard: KeyEsc + target_event: + gamepad: + button: QuickAccess + - name: Keyboard + source_events: + - keyboard: KeyO + - keyboard: KeyLeftCtrl + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: Keyboard + - name: Windows + source_events: + - keyboard: KeyD + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: Guide + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type1.yaml b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type1.yaml new file mode 100644 index 00000000..13c108fa --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type1.yaml @@ -0,0 +1,47 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: AYANEO Type 1 + +# Unique identifier of the capability mapping +id: aya1 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + #TODO: Figure out how to use this and also KB. + #- name: Win + # source_events: + # - keyboard: KeyLeftMeta + # target_event: + # gamepad: + # button: Screenshot + - name: Task Manager + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyRightAlt + - keyboard: KeyDelete + target_event: + gamepad: + button: QuickAccess + - name: Keyboard + source_events: + - keyboard: KeyO + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: Keyboard + - name: Escape + source_events: + - keyboard: KeyEsc + target_event: + gamepad: + button: QuickAccess2 + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type2.yaml b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type2.yaml new file mode 100644 index 00000000..114edd96 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type2.yaml @@ -0,0 +1,48 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: AYANEO Type 2 + +# Unique identifier of the capability mapping +id: aya2 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: Custom v1 + source_events: + - keyboard: KeyApostrophe + - keyboard: KeyCopy + target_event: + gamepad: + button: QuickAccess + - name: Custom v2 + source_events: + - keyboard: KeyD + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: QuickAccess + - name: Aya Space v1 + source_events: + - keyboard: KeyKpEnter + - keyboard: KeyLeft + - keyboard: KeyCopy + target_event: + gamepad: + button: Guide + - name: Aya Space v2 + source_events: + - keyboard: KeyF12 + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: Guide + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type3.yaml b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type3.yaml new file mode 100644 index 00000000..c1758c63 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type3.yaml @@ -0,0 +1,49 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: AYANEO Type 3 + +# Unique identifier of the capability mapping +id: aya3 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: Custom + source_events: + - keyboard: KeyD + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: QuickAccess + - name: Aya Space + source_events: + - keyboard: KeyF12 + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: Guide + - name: LC + source_events: + - keyboard: KeyF11 + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: LeftTop + - name: RC + source_events: + - keyboard: KeyF10 + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: RightTop + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type4.yaml b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type4.yaml new file mode 100644 index 00000000..754a0f64 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type4.yaml @@ -0,0 +1,49 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: AYANEO Type 4 + +# Unique identifier of the capability mapping +id: aya4 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: Custom + source_events: + - keyboard: KeyD + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: QuickAccess + - name: Aya Space + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyF17 + target_event: + gamepad: + button: Guide + - name: LC + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyF15 + target_event: + gamepad: + button: LeftTop + - name: RC + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyF16 + target_event: + gamepad: + button: RightTop + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type5.yaml b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type5.yaml new file mode 100644 index 00000000..2f3e9075 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type5.yaml @@ -0,0 +1,49 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: AYANEO Type 5 + +# Unique identifier of the capability mapping +id: aya5 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: Custom + source_events: + - keyboard: KeyD + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: QuickAccess + - name: Aya Space + source_events: + - keyboard: KeyLeftCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyF17 + target_event: + gamepad: + button: Guide + - name: LC + source_events: + - keyboard: KeyLeftCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyF15 + target_event: + gamepad: + button: LeftTop + - name: RC + source_events: + - keyboard: KeyLeftCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyF16 + target_event: + gamepad: + button: RightTop + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type6.yaml b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type6.yaml new file mode 100644 index 00000000..a2f530c8 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/ayaneo_type6.yaml @@ -0,0 +1,57 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: AYANEO Type 6 + +# Unique identifier of the capability mapping +id: aya6 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: Custom + source_events: + - keyboard: KeyD + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: QuickAccess + - name: Aya Space + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyF17 + target_event: + gamepad: + button: QuickAccess2 + - name: LC + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyF15 + target_event: + gamepad: + button: LeftTop + - name: RC + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyF16 + target_event: + gamepad: + button: RightTop + - name: T + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyF18 + target_event: + gamepad: + button: RightTop #TODO: Add FrontRightTop to schema + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/ayn_type1.yaml b/rootfs/usr/share/inputplumber/capability_maps/ayn_type1.yaml new file mode 100644 index 00000000..2b054191 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/ayn_type1.yaml @@ -0,0 +1,33 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: AYN Type 1 + +# Unique identifier of the capability mapping +id: ayn1 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: Lower Right + source_events: + - keyboard: KeyT + - keyboard: KeyLeftCtrl + - keyboard: KeyLeftShift + - keyboard: KeyLeftAlt + target_event: + gamepad: + button: QuickAccess + - name: Lower Left + Lower Right + source_events: + - keyboard: KeyDelete + target_event: + gamepad: + button: QuickAccess2 + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/gpd_type1.yaml b/rootfs/usr/share/inputplumber/capability_maps/gpd_type1.yaml new file mode 100644 index 00000000..d0f74d99 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/gpd_type1.yaml @@ -0,0 +1,32 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: GPD Type 1 + +# Unique identifier of the capability mapping +id: gpd1 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: Left Paddle + source_events: + - keyboard: KeyLeftCtrl + - keyboard: KeyLeftAlt + - keyboard: KeyDelete + target_event: + gamepad: + button: LeftPaddle1 + - name: Right Paddle + source_events: + - keyboard: KeyEsc + target_event: + gamepad: + button: RightPaddle1 + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/gpd_type2.yaml b/rootfs/usr/share/inputplumber/capability_maps/gpd_type2.yaml new file mode 100644 index 00000000..12eddf46 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/gpd_type2.yaml @@ -0,0 +1,30 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: GPD Type 2 + +# Unique identifier of the capability mapping +id: gpd2 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: Left Paddle + source_events: + - keyboard: Key0 + target_event: + gamepad: + button: LeftPaddle1 + - name: Right Paddle + source_events: + - keyboard: Key9 + target_event: + gamepad: + button: RightPaddle1 + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/gpd_type3.yaml b/rootfs/usr/share/inputplumber/capability_maps/gpd_type3.yaml new file mode 100644 index 00000000..27424cf2 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/gpd_type3.yaml @@ -0,0 +1,30 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: GPD Type 1 + +# Unique identifier of the capability mapping +id: gpd1 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: Left Paddle + source_events: + - keyboard: KeyPause + target_event: + gamepad: + button: LeftPaddle1 + - name: Right Paddle + source_events: + - keyboard: KeySysrq + target_event: + gamepad: + button: RightPaddle1 + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type1.yaml b/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type1.yaml new file mode 100644 index 00000000..778b45db --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type1.yaml @@ -0,0 +1,48 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: OneXPlayer Type 1 + +# Unique identifier of the capability mapping +id: oxp1 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: KB (Short Press) + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyO + target_event: + gamepad: + button: Keyboard + - name: Orange Button (Short Press) + source_events: + - keyboard: KeyLeftMeta + - keyboard: KeyD + target_event: + gamepad: + button: QuickAccess + - name: Turbo + Orange Button + source_events: + - keyboard: KeyLeftMeta + - keyboard: KeySysrq + target_event: + gamepad: + button: QuickAccess2 + - name: KB + Orange Button + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyRightAlt + - keyboard: KeyDelete + target_event: + gamepad: + button: Screenshot + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type2.yaml b/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type2.yaml new file mode 100644 index 00000000..8250b02b --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type2.yaml @@ -0,0 +1,55 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: OneXPlayer Type 2 + +# Unique identifier of the capability mapping +id: oxp2 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: KB (Short Press) + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyLeftMeta + - keyboard: KeyO + target_event: + gamepad: + button: Keyboard + - name: Orange Button (Short Press) + source_events: + - keyboard: KeyLeftMeta + - keyboard: KeyD + target_event: + gamepad: + button: Guide + - name: Orange Button (Long Press) + source_events: + - keyboard: KeyLeftMeta + - keyboard: KeyG + target_event: + gamepad: + button: QuickAccess + - name: Turbo + Orange Button + source_events: + - keyboard: KeyLeftMeta + - keyboard: KeySysrq + target_event: + gamepad: + button: QuickAccess2 + - name: KB + Orange Button + source_events: + - keyboard: KeyRightCtrl + - keyboard: KeyRightAlt + - keyboard: KeyDelete + target_event: + gamepad: + button: Screenshot + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type4.yaml b/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type4.yaml new file mode 100644 index 00000000..eeb2fdf2 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/onexplayer_type4.yaml @@ -0,0 +1,39 @@ +# yaml-language-server: $schema=../schema/capability_map_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: OneXPlayer Type 4 + +# Unique identifier of the capability mapping +id: oxp4 + +# List of mapped events that are activated by a specific set of activation keys. +mapping: + - name: Volume Up + source_events: + - keyboard: KeyLeftMeta + - keyboard: KeyD + target_event: + keyboard: KeyVolumeUp + - name: Volume Down + source_events: + - keyboard: KeyO + - keyboard: KeyLeftCtrl + - keyboard: KeyLeftMeta + target_event: + keyboard: KeyVolumeDown + - name: Turbo + source_events: + - keyboard: KeyLeftCtrl + - keyboard: KeyLeftAlt + - keyboard: KeyLeftMeta + target_event: + gamepad: + button: QuickAccess + +# List of events to filter from the source devices +filtered_events: [] diff --git a/rootfs/usr/share/inputplumber/devices/win_600.yaml b/rootfs/usr/share/inputplumber/devices/50-anbernic_win600.yaml similarity index 95% rename from rootfs/usr/share/inputplumber/devices/win_600.yaml rename to rootfs/usr/share/inputplumber/devices/50-anbernic_win600.yaml index 9ab53bd4..ccc1b021 100644 --- a/rootfs/usr/share/inputplumber/devices/win_600.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-anbernic_win600.yaml @@ -14,7 +14,7 @@ name: Anbernic Win 600 matches: - dmi_data: product_name: Win600 - sys_vendor: ANBERNIC + sys_vendor: ANBERNIC # 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. @@ -35,4 +35,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: anb1 +capability_map_id: anb1 diff --git a/rootfs/usr/share/inputplumber/devices/aokzoe_a1.yaml b/rootfs/usr/share/inputplumber/devices/50-aokzoe_a1.yaml similarity index 98% rename from rootfs/usr/share/inputplumber/devices/aokzoe_a1.yaml rename to rootfs/usr/share/inputplumber/devices/50-aokzoe_a1.yaml index 74dd463e..16c3aa04 100644 --- a/rootfs/usr/share/inputplumber/devices/aokzoe_a1.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-aokzoe_a1.yaml @@ -42,4 +42,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: oxp3 +capability_map_id: oxp3 diff --git a/rootfs/usr/share/inputplumber/devices/ayaneo_2.yaml b/rootfs/usr/share/inputplumber/devices/50-ayaneo_2.yaml similarity index 97% rename from rootfs/usr/share/inputplumber/devices/ayaneo_2.yaml rename to rootfs/usr/share/inputplumber/devices/50-ayaneo_2.yaml index c4378b46..063a5852 100644 --- a/rootfs/usr/share/inputplumber/devices/ayaneo_2.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-ayaneo_2.yaml @@ -38,4 +38,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: aya4 +capability_map_id: aya4 diff --git a/rootfs/usr/share/inputplumber/devices/ayaneo_2021.yaml b/rootfs/usr/share/inputplumber/devices/50-ayaneo_2021.yaml similarity index 98% rename from rootfs/usr/share/inputplumber/devices/ayaneo_2021.yaml rename to rootfs/usr/share/inputplumber/devices/50-ayaneo_2021.yaml index a018cc06..2ac7c057 100644 --- a/rootfs/usr/share/inputplumber/devices/ayaneo_2021.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-ayaneo_2021.yaml @@ -47,4 +47,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: aya1 +capability_map_id: aya1 diff --git a/rootfs/usr/share/inputplumber/devices/ayaneo_2s.yaml b/rootfs/usr/share/inputplumber/devices/50-ayaneo_2s.yaml similarity index 98% rename from rootfs/usr/share/inputplumber/devices/ayaneo_2s.yaml rename to rootfs/usr/share/inputplumber/devices/50-ayaneo_2s.yaml index c32dbd0a..99d7fba9 100644 --- a/rootfs/usr/share/inputplumber/devices/ayaneo_2s.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-ayaneo_2s.yaml @@ -44,4 +44,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: aya4 +capability_map_id: aya4 diff --git a/rootfs/usr/share/inputplumber/devices/ayaneo_air.yaml b/rootfs/usr/share/inputplumber/devices/50-ayaneo_air.yaml similarity index 97% rename from rootfs/usr/share/inputplumber/devices/ayaneo_air.yaml rename to rootfs/usr/share/inputplumber/devices/50-ayaneo_air.yaml index 56131d2a..8ed0652b 100644 --- a/rootfs/usr/share/inputplumber/devices/ayaneo_air.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-ayaneo_air.yaml @@ -38,4 +38,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: aya3 +capability_map_id: aya3 diff --git a/rootfs/usr/share/inputplumber/devices/ayaneo_air_plus.yaml b/rootfs/usr/share/inputplumber/devices/50-ayaneo_air_plus.yaml similarity index 98% rename from rootfs/usr/share/inputplumber/devices/ayaneo_air_plus.yaml rename to rootfs/usr/share/inputplumber/devices/50-ayaneo_air_plus.yaml index 4fa2beae..73afc8d3 100644 --- a/rootfs/usr/share/inputplumber/devices/ayaneo_air_plus.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-ayaneo_air_plus.yaml @@ -49,4 +49,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: aya5 +capability_map_id: aya5 diff --git a/rootfs/usr/share/inputplumber/devices/ayaneo_kun.yaml b/rootfs/usr/share/inputplumber/devices/50-ayaneo_kun.yaml similarity index 97% rename from rootfs/usr/share/inputplumber/devices/ayaneo_kun.yaml rename to rootfs/usr/share/inputplumber/devices/50-ayaneo_kun.yaml index a8a261c7..42878da8 100644 --- a/rootfs/usr/share/inputplumber/devices/ayaneo_kun.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-ayaneo_kun.yaml @@ -15,7 +15,7 @@ matches: - dmi_data: product_name: AYANEO KUN sys_vendor: AYANEO - + # 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: @@ -35,4 +35,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: aya4 +capability_map_id: aya6 diff --git a/rootfs/usr/share/inputplumber/devices/ayaneo_next.yaml b/rootfs/usr/share/inputplumber/devices/50-ayaneo_next.yaml similarity index 98% rename from rootfs/usr/share/inputplumber/devices/ayaneo_next.yaml rename to rootfs/usr/share/inputplumber/devices/50-ayaneo_next.yaml index a0888e24..b1e3a993 100644 --- a/rootfs/usr/share/inputplumber/devices/ayaneo_next.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-ayaneo_next.yaml @@ -53,4 +53,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: aya2 +capability_map_id: aya2 diff --git a/rootfs/usr/share/inputplumber/devices/ayaneo_slide.yaml b/rootfs/usr/share/inputplumber/devices/50-ayaneo_slide.yaml similarity index 97% rename from rootfs/usr/share/inputplumber/devices/ayaneo_slide.yaml rename to rootfs/usr/share/inputplumber/devices/50-ayaneo_slide.yaml index 5783b479..872e8669 100644 --- a/rootfs/usr/share/inputplumber/devices/ayaneo_slide.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-ayaneo_slide.yaml @@ -36,4 +36,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: aya5 +capability_map_id: aya5 diff --git a/rootfs/usr/share/inputplumber/devices/ayn_loki.yaml b/rootfs/usr/share/inputplumber/devices/50-ayn_loki.yaml similarity index 98% rename from rootfs/usr/share/inputplumber/devices/ayn_loki.yaml rename to rootfs/usr/share/inputplumber/devices/50-ayn_loki.yaml index d57846ac..479170f4 100644 --- a/rootfs/usr/share/inputplumber/devices/ayn_loki.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-ayn_loki.yaml @@ -49,4 +49,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: loki1 +capability_map_id: ayn1 diff --git a/rootfs/usr/share/inputplumber/devices/gpd_win3.yaml b/rootfs/usr/share/inputplumber/devices/50-gpd_win3.yaml similarity index 97% rename from rootfs/usr/share/inputplumber/devices/gpd_win3.yaml rename to rootfs/usr/share/inputplumber/devices/50-gpd_win3.yaml index be951452..0d76db07 100644 --- a/rootfs/usr/share/inputplumber/devices/gpd_win3.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-gpd_win3.yaml @@ -35,4 +35,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: gpd1 +capability_map_id: gpd1 diff --git a/rootfs/usr/share/inputplumber/devices/gpd_win4.yaml b/rootfs/usr/share/inputplumber/devices/50-gpd_win4.yaml similarity index 97% rename from rootfs/usr/share/inputplumber/devices/gpd_win4.yaml rename to rootfs/usr/share/inputplumber/devices/50-gpd_win4.yaml index 2939b01c..7f089b0f 100644 --- a/rootfs/usr/share/inputplumber/devices/gpd_win4.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-gpd_win4.yaml @@ -35,4 +35,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: gpd3 +capability_map_id: gpd3 diff --git a/rootfs/usr/share/inputplumber/devices/gpd_winmax2.yaml b/rootfs/usr/share/inputplumber/devices/50-gpd_winmax2.yaml similarity index 97% rename from rootfs/usr/share/inputplumber/devices/gpd_winmax2.yaml rename to rootfs/usr/share/inputplumber/devices/50-gpd_winmax2.yaml index 9bf6085a..5cbb6484 100644 --- a/rootfs/usr/share/inputplumber/devices/gpd_winmax2.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-gpd_winmax2.yaml @@ -35,4 +35,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: gpd2 +capability_map_id: gpd2 diff --git a/rootfs/usr/share/inputplumber/devices/gpd_winmini.yaml b/rootfs/usr/share/inputplumber/devices/50-gpd_winmini.yaml similarity index 97% rename from rootfs/usr/share/inputplumber/devices/gpd_winmini.yaml rename to rootfs/usr/share/inputplumber/devices/50-gpd_winmini.yaml index f66b97a6..714fabd9 100644 --- a/rootfs/usr/share/inputplumber/devices/gpd_winmini.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-gpd_winmini.yaml @@ -35,4 +35,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: gpd3 +capability_map_id: gpd3 diff --git a/rootfs/usr/share/inputplumber/devices/onexplayer_2.yaml b/rootfs/usr/share/inputplumber/devices/50-onexplayer_2.yaml similarity index 98% rename from rootfs/usr/share/inputplumber/devices/onexplayer_2.yaml rename to rootfs/usr/share/inputplumber/devices/50-onexplayer_2.yaml index f232cf8c..33682277 100644 --- a/rootfs/usr/share/inputplumber/devices/onexplayer_2.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-onexplayer_2.yaml @@ -45,4 +45,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: oxp4 +capability_map_id: oxp4 diff --git a/rootfs/usr/share/inputplumber/devices/50-onexplayer_intel.yaml b/rootfs/usr/share/inputplumber/devices/50-onexplayer_intel.yaml index c49c6f05..3a6844be 100644 --- a/rootfs/usr/share/inputplumber/devices/50-onexplayer_intel.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-onexplayer_intel.yaml @@ -18,7 +18,7 @@ matches: cpu_vendor: GenuineIntel - dmi_data: product_name: ONE XPLAYER - sys_vendor: ONE-NETBOOK + sys_vendor: ONE-NETBOOK TECHNOLOGY CO., LTD. cpu_vendor: GenuineIntel # One or more source devices to combine into a single virtual device. The events diff --git a/rootfs/usr/share/inputplumber/devices/onexplayer_mini_pro.yaml b/rootfs/usr/share/inputplumber/devices/50-onexplayer_mini_pro.yaml similarity index 97% rename from rootfs/usr/share/inputplumber/devices/onexplayer_mini_pro.yaml rename to rootfs/usr/share/inputplumber/devices/50-onexplayer_mini_pro.yaml index 5f4051df..f0440a63 100644 --- a/rootfs/usr/share/inputplumber/devices/onexplayer_mini_pro.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-onexplayer_mini_pro.yaml @@ -35,4 +35,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: oxp3 +capability_map_id: oxp3 diff --git a/rootfs/usr/share/inputplumber/devices/onexplayer_onexfly.yaml b/rootfs/usr/share/inputplumber/devices/50-onexplayer_onexfly.yaml similarity index 97% rename from rootfs/usr/share/inputplumber/devices/onexplayer_onexfly.yaml rename to rootfs/usr/share/inputplumber/devices/50-onexplayer_onexfly.yaml index eb7198e9..01bcf0b9 100644 --- a/rootfs/usr/share/inputplumber/devices/onexplayer_onexfly.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-onexplayer_onexfly.yaml @@ -35,4 +35,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: oxp3 +capability_map_id: oxp3 diff --git a/rootfs/usr/share/inputplumber/devices/50-rog_ally.yaml b/rootfs/usr/share/inputplumber/devices/50-rog_ally.yaml new file mode 100644 index 00000000..4d868dcf --- /dev/null +++ b/rootfs/usr/share/inputplumber/devices/50-rog_ally.yaml @@ -0,0 +1,39 @@ +# yaml-language-server: $schema=../schema/composite_device_v1.json +# Schema version number +version: 1 + +# The type of configuration schema +kind: CompositeDevice + +# Name of the composite device mapping +name: ASUS ROG Ally + +# 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: + - dmi_data: + board_name: RC71L + sys_vendor: ASUSTeK COMPUTER INC. + +# 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 + evdev: + name: Microsoft X-Box 360 pad + phys_path: usb-0000:0[8-a]:00.3-2/input0 + - group: keyboard + unique: false + evdev: + name: Asus Keyboard + phys_path: usb-0000:0[8-a]:00.3-3/input[0-2] + +# The target input device(s) that the virtual device profile can use +target_devices: + - gamepad + - mouse + - keyboard + +# The ID of a device event mapping in the 'event_maps' folder +capability_map_id: aly1 diff --git a/rootfs/usr/share/inputplumber/devices/anbernic_win600.yaml b/rootfs/usr/share/inputplumber/devices/50-win_600.yaml similarity index 97% rename from rootfs/usr/share/inputplumber/devices/anbernic_win600.yaml rename to rootfs/usr/share/inputplumber/devices/50-win_600.yaml index 9ab53bd4..c766969e 100644 --- a/rootfs/usr/share/inputplumber/devices/anbernic_win600.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-win_600.yaml @@ -35,4 +35,4 @@ target_devices: - keyboard # The ID of a device event mapping in the 'event_maps' folder -event_map_id: anb1 +capability_map_id: anb1 diff --git a/rootfs/usr/share/inputplumber/devices/rog_ally.yaml b/rootfs/usr/share/inputplumber/devices/rog_ally.yaml deleted file mode 100644 index 9abe2ee0..00000000 --- a/rootfs/usr/share/inputplumber/devices/rog_ally.yaml +++ /dev/null @@ -1,66 +0,0 @@ -# yaml-language-server: $schema=../schema/composite_device_v1.json -# Schema version number -version: 1 - -# The type of configuration schema -kind: CompositeDevice - -# Name of the composite device mapping -name: ASUS ROG Ally - -# 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: - - dmi_data: - board_name: RC71L - sys_vendor: ASUSTeK COMPUTER INC. - -# 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 - evdev: - name: Microsoft X-Box 360 pad - phys_path: usb-0000:08:00.3-2/input0 - - group: gamepad - evdev: - name: Microsoft X-Box 360 pad - phys_path: usb-0000:09:00.3-2/input0 - - group: gamepad - evdev: - name: Microsoft X-Box 360 pad - phys_path: usb-0000:0a:00.3-2/input0 - - group: keyboard - evdev: - name: Asus Keyboard - phys_path: usb-0000:08:00.3-3/input0 - - group: keyboard - evdev: - name: Asus Keyboard - phys_path: usb-0000:08:00.3-3/input2 - - group: keyboard - evdev: - name: Asus Keyboard - phys_path: usb-0000:09:00.3-3/input0 - - group: keyboard - evdev: - name: Asus Keyboard - phys_path: usb-0000:09:00.3-3/input2 - - group: keyboard - evdev: - name: Asus Keyboard - phys_path: usb-0000:0a:00.3-3/input0 - - group: keyboard - evdev: - name: Asus Keyboard - phys_path: usb-0000:0a:00.3-3/input2 - -# The target input device(s) that the virtual device profile can use -target_devices: - - gamepad - - mouse - - keyboard - -# The ID of a device event mapping in the 'event_maps' folder -event_map_id: ally1 diff --git a/rootfs/usr/share/inputplumber/schema/capability_map_v1.json b/rootfs/usr/share/inputplumber/schema/capability_map_v1.json index 4a45874e..c05634dd 100644 --- a/rootfs/usr/share/inputplumber/schema/capability_map_v1.json +++ b/rootfs/usr/share/inputplumber/schema/capability_map_v1.json @@ -229,7 +229,8 @@ "KeyF21", "KeyF22", "KeyF23", - "KeyF24" + "KeyF24", + "KeyProg1" ] }, "gamepad": { diff --git a/src/input/capability.rs b/src/input/capability.rs index 5fee6c65..5baf4821 100644 --- a/src/input/capability.rs +++ b/src/input/capability.rs @@ -492,6 +492,7 @@ pub enum Keyboard { KeyF22, KeyF23, KeyF24, + KeyProg1, } impl fmt::Display for Keyboard { @@ -657,6 +658,7 @@ impl fmt::Display for Keyboard { Keyboard::KeyF22 => write!(f, "KeyF22"), Keyboard::KeyF23 => write!(f, "KeyF23"), Keyboard::KeyF24 => write!(f, "KeyF24"), + Keyboard::KeyProg1 => write!(f, "KeyProg1"), } } } @@ -826,6 +828,7 @@ impl FromStr for Keyboard { "KeyF22" => Ok(Keyboard::KeyF22), "KeyF23" => Ok(Keyboard::KeyF23), "KeyF24" => Ok(Keyboard::KeyF24), + "KeyProg1" => Ok(Keyboard::KeyProg1), _ => Err(()), } } diff --git a/src/input/event/dbus.rs b/src/input/event/dbus.rs index ab4ba362..3d7e3796 100644 --- a/src/input/event/dbus.rs +++ b/src/input/event/dbus.rs @@ -339,6 +339,7 @@ fn actions_from_capability(capability: Capability) -> Vec { Keyboard::KeyF22 => vec![Action::None], Keyboard::KeyF23 => vec![Action::None], Keyboard::KeyF24 => vec![Action::None], + Keyboard::KeyProg1 => vec![Action::None], }, } } diff --git a/src/input/event/evdev.rs b/src/input/event/evdev.rs index 910b44eb..0f4a7c09 100644 --- a/src/input/event/evdev.rs +++ b/src/input/event/evdev.rs @@ -289,7 +289,7 @@ impl EvdevEvent { KeyCode::KEY_SENDFILE => Capability::NotImplemented, KeyCode::KEY_DELETEFILE => Capability::NotImplemented, KeyCode::KEY_XFER => Capability::NotImplemented, - KeyCode::KEY_PROG1 => Capability::NotImplemented, + KeyCode::KEY_PROG1 => Capability::Keyboard(Keyboard::KeyProg1), KeyCode::KEY_PROG2 => Capability::NotImplemented, KeyCode::KEY_WWW => Capability::Keyboard(Keyboard::KeyWww), KeyCode::KEY_MSDOS => Capability::NotImplemented, @@ -786,6 +786,7 @@ fn event_codes_from_capability(capability: Capability) -> Vec { Keyboard::KeyF22 => vec![KeyCode::KEY_F22.0], Keyboard::KeyF23 => vec![KeyCode::KEY_F23.0], Keyboard::KeyF24 => vec![KeyCode::KEY_F24.0], + Keyboard::KeyProg1 => vec![KeyCode::KEY_PROG1.0], }, } } diff --git a/src/input/target/keyboard.rs b/src/input/target/keyboard.rs index fbd471bc..8c6f8999 100644 --- a/src/input/target/keyboard.rs +++ b/src/input/target/keyboard.rs @@ -321,6 +321,7 @@ impl KeyboardDevice { keys.insert(KeyCode::KEY_F22); keys.insert(KeyCode::KEY_F23); keys.insert(KeyCode::KEY_F24); + keys.insert(KeyCode::KEY_PROG1); let device = VirtualDeviceBuilder::new()? .name("InputPlumber Keyboard") @@ -494,6 +495,7 @@ fn capability_from_key_string(key: &str) -> Capability { "KEY_F22" => Capability::Keyboard(Keyboard::KeyF22), "KEY_F23" => Capability::Keyboard(Keyboard::KeyF23), "KEY_F24" => Capability::Keyboard(Keyboard::KeyF24), + "KEY_PROG1" => Capability::Keyboard(Keyboard::KeyProg1), _ => Capability::NotImplemented, } }