From 74ef9fe0b7b2343bbf4cb75613b2ce7cdf4a99d4 Mon Sep 17 00:00:00 2001 From: khasburrahman <19620774+khasburrahman@users.noreply.github.com> Date: Wed, 11 Nov 2026 21:57:49 +0700 Subject: [PATCH 1/2] feat(support): add home button mapping for advan handheld pc Assisted-by: LLM --- .../usr/lib/udev/hwdb.d/59-inputplumber.hwdb | 7 +++ .../hwdb.d/60-inputplumber-autostart.hwdb | 2 + .../capability_maps/advan_type1.yaml | 28 +++++++++ .../inputplumber/devices/50-advan_xplay.yaml | 57 +++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 rootfs/usr/share/inputplumber/capability_maps/advan_type1.yaml create mode 100644 rootfs/usr/share/inputplumber/devices/50-advan_xplay.yaml diff --git a/rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb b/rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb index 2bc198b14..95b6a0181 100644 --- a/rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb +++ b/rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb @@ -1,3 +1,10 @@ +# ADVAN X-PLAY +# The Home button is reported as Win+D (scancodes 0xdb + 0x20) by the +# embedded controller. Map it to a spare key and drop the extra event. +evdev:name:AT Translated Set 2 keyboard:dmi:*:svnADVAN:pn1301:* + KEYBOARD_KEY_db=f16 + KEYBOARD_KEY_20=reserved + # AYANEO Devices evdev:name:AT Translated Set 2 keyboard:dmi:*:svnAYANEO:* KEYBOARD_KEY_66=f15 diff --git a/rootfs/usr/lib/udev/hwdb.d/60-inputplumber-autostart.hwdb b/rootfs/usr/lib/udev/hwdb.d/60-inputplumber-autostart.hwdb index 80a349475..b48736ace 100644 --- a/rootfs/usr/lib/udev/hwdb.d/60-inputplumber-autostart.hwdb +++ b/rootfs/usr/lib/udev/hwdb.d/60-inputplumber-autostart.hwdb @@ -1,3 +1,5 @@ +# ADVAN X-PLAY +dmi:*svnADVAN:pn1301:* # Anbernic dmi:*svnAnbernic:pnWin600:* # AOKZOE A1 diff --git a/rootfs/usr/share/inputplumber/capability_maps/advan_type1.yaml b/rootfs/usr/share/inputplumber/capability_maps/advan_type1.yaml new file mode 100644 index 000000000..ce265a622 --- /dev/null +++ b/rootfs/usr/share/inputplumber/capability_maps/advan_type1.yaml @@ -0,0 +1,28 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/ShadowBlip/InputPlumber/main/rootfs/usr/share/inputplumber/schema/capability_map_v2.json +# Schema version number +version: 2 + +# The type of configuration schema +kind: CapabilityMap + +# Name for the device event map +name: ADVAN X-PLAY + +# Unique identifier of the capability mapping +id: advan1 + +# List of mapped events +mapping: + # The embedded controller reports the Home button with scancodes 0xdb + 0x20. + # 59-inputplumber.hwdb remaps these to KEY_F16 and a reserved key. + - name: Home + mapping_type: + evdev: chord + source_events: + - evdev: + event_type: KEY + event_code: KEY_F16 + value_type: button + target_event: + gamepad: + button: Guide diff --git a/rootfs/usr/share/inputplumber/devices/50-advan_xplay.yaml b/rootfs/usr/share/inputplumber/devices/50-advan_xplay.yaml new file mode 100644 index 000000000..0b493ee02 --- /dev/null +++ b/rootfs/usr/share/inputplumber/devices/50-advan_xplay.yaml @@ -0,0 +1,57 @@ +# 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: ADVAN X-PLAY + +# 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 matches. If this list is +# empty, then the source devices will *always* be checked. +# /sys/class/dmi/id/product_name +matches: + - dmi_data: + product_name: "1301" + sys_vendor: ADVAN + +# 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: Generic X-Box pad + vendor_id: "2f24" + product_id: "0135" + handler: event* + events: + exclude: + # The pad has no dedicated Guide button. Holding the Home button makes + # the embedded controller report one, which would trigger the Guide + # action a second time. Guide is provided by the keyboard source below. + - Gamepad:Button:Guide + # The embedded controller exposes the Home button with scancodes 0xdb + 0x20. + # 59-inputplumber.hwdb remaps these to KEY_F16 and a reserved key. + - group: keyboard + evdev: + name: AT Translated Set 2 keyboard + phys_path: isa0060/serio0/input0 + handler: event* + capability_map_id: advan1 + +# 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 From da9ed7cac55a067b3f4a6cd82a6ecbbd9fd4acba Mon Sep 17 00:00:00 2001 From: khasburrahman <19620774+khasburrahman@users.noreply.github.com> Date: Fri, 13 Nov 2026 15:29:28 +0700 Subject: [PATCH 2/2] refactor(support): removes the unnecssary hwdb mapping for advan home button --- rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb | 7 ------- .../share/inputplumber/capability_maps/advan_type1.yaml | 8 +++++--- rootfs/usr/share/inputplumber/devices/50-advan_xplay.yaml | 2 -- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb b/rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb index 95b6a0181..2bc198b14 100644 --- a/rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb +++ b/rootfs/usr/lib/udev/hwdb.d/59-inputplumber.hwdb @@ -1,10 +1,3 @@ -# ADVAN X-PLAY -# The Home button is reported as Win+D (scancodes 0xdb + 0x20) by the -# embedded controller. Map it to a spare key and drop the extra event. -evdev:name:AT Translated Set 2 keyboard:dmi:*:svnADVAN:pn1301:* - KEYBOARD_KEY_db=f16 - KEYBOARD_KEY_20=reserved - # AYANEO Devices evdev:name:AT Translated Set 2 keyboard:dmi:*:svnAYANEO:* KEYBOARD_KEY_66=f15 diff --git a/rootfs/usr/share/inputplumber/capability_maps/advan_type1.yaml b/rootfs/usr/share/inputplumber/capability_maps/advan_type1.yaml index ce265a622..87c6fdcc2 100644 --- a/rootfs/usr/share/inputplumber/capability_maps/advan_type1.yaml +++ b/rootfs/usr/share/inputplumber/capability_maps/advan_type1.yaml @@ -13,15 +13,17 @@ id: advan1 # List of mapped events mapping: - # The embedded controller reports the Home button with scancodes 0xdb + 0x20. - # 59-inputplumber.hwdb remaps these to KEY_F16 and a reserved key. - name: Home mapping_type: evdev: chord source_events: - evdev: event_type: KEY - event_code: KEY_F16 + event_code: KEY_LEFTMETA + value_type: button + - evdev: + event_type: KEY + event_code: KEY_D value_type: button target_event: gamepad: diff --git a/rootfs/usr/share/inputplumber/devices/50-advan_xplay.yaml b/rootfs/usr/share/inputplumber/devices/50-advan_xplay.yaml index 0b493ee02..e389acbcd 100644 --- a/rootfs/usr/share/inputplumber/devices/50-advan_xplay.yaml +++ b/rootfs/usr/share/inputplumber/devices/50-advan_xplay.yaml @@ -34,8 +34,6 @@ source_devices: # the embedded controller report one, which would trigger the Guide # action a second time. Guide is provided by the keyboard source below. - Gamepad:Button:Guide - # The embedded controller exposes the Home button with scancodes 0xdb + 0x20. - # 59-inputplumber.hwdb remaps these to KEY_F16 and a reserved key. - group: keyboard evdev: name: AT Translated Set 2 keyboard