Skip to content

feat(HardwareSupport): Add guide button mapping for advan xplay handheld pc - #805

Open
khasburrahman wants to merge 2 commits into
ShadowBlip:mainfrom
khasburrahman:feat/advan-home-btn-support
Open

khasburrahman wants to merge 2 commits into
ShadowBlip:mainfrom
khasburrahman:feat/advan-home-btn-support

Conversation

@khasburrahman

@khasburrahman khasburrahman commented Nov 12, 2026 •

Copy link
Copy Markdown

Hello, first time contributor here!
I'm adding support for handheld PC: advan xplay. Looking to share with everyone having this device using inputplumber/bazzite, been overriding locally the past months.

I figured the button event using evtest. The behavior of this handheld:

  • the home button register as windows + d
  • holding the home button trigger it's internal xbox controller home button

Changelog:

  • added config to support advan x-play handheld pc home button
    • enable the inputplumber for the device, identify the system dmi and product name
    • mapped windows + d to guide(xbox) button
    • holding home button no longer trigger guide(xbox) button

How I tested the changes:
Since it's all config changes, I found separate thread discussing we can override the config manually.
I'm testing the changes in bazzite. I tested the change locally by copying the config file manually to:

  • /etc/inputplumber/devices.d/
  • /etc/inputplumber/capability_maps.d/
  • /etc/udev/hwdb.d/

Then trigger the hwdb update

sudo systemd-hwdb update
sudo udevadm trigger --action=add --subsystem-match=input

and restart the service

systemctl restart inputplumber

Notes:

  • the QAM button is not registered in evtest, managed to figure the button register using hidraw and have c program to map that.
  • I saw there's open PR for generic hidraw, I'm experimenting whether to use that or implement the driver in rust.
  • this PR is Assisted-by: LLM, I'm using the llm to find the relevant directory

# 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

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.

Rather than add this, you can just add both source events in the capability mapping.

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.

Updated, moved the mapping to capability maps

- name: Home
mapping_type:
evdev: chord
source_events:

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.

Here you can just have two source event entries, one for win and one for D

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.

Thank you! much simpler this way

handler: event*
events:
exclude:
# The pad has no dedicated Guide button. Holding the Home button makes

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.

Does the win+d release when this fires, or do both release at the same time?

@khasburrahman khasburrahman Nov 13, 2026 •

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.

It released almost at the same time, this is the home button reading, when tapping it

Event: time 1794560278.272687, type 4 (EV_MSC), code 4 (MSC_SCAN), value db
Event: time 1794560278.272687, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 1
Event: time 1794560278.272687, -------------- SYN_REPORT ------------
Event: time 1794560278.274710, type 4 (EV_MSC), code 4 (MSC_SCAN), value 20
Event: time 1794560278.274710, type 1 (EV_KEY), code 32 (KEY_D), value 1
Event: time 1794560278.274710, -------------- SYN_REPORT ------------
Event: time 1794560278.279796, type 4 (EV_MSC), code 4 (MSC_SCAN), value 20
Event: time 1794560278.279796, type 1 (EV_KEY), code 32 (KEY_D), value 0
Event: time 1794560278.279796, -------------- SYN_REPORT ------------
Event: time 1794560278.287845, type 4 (EV_MSC), code 4 (MSC_SCAN), value db
Event: time 1794560278.287845, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 0
Event: time 1794560278.287845, -------------- SYN_REPORT ------------

when holding the home button, after about a second it'll trigger the guide button on internal generic controller, but it immediately released.
it doesn't register hold (2) with prolonged hold.

Event: time 1794560421.164268, type 1 (EV_KEY), code 316 (BTN_MODE), value 1
Event: time 1794560421.164268, -------------- SYN_REPORT ------------
Event: time 1794560421.284113, type 1 (EV_KEY), code 316 (BTN_MODE), value 0
Event: time 1794560421.284113, -------------- SYN_REPORT ------------

@pastaq

pastaq commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Accessing QAM via the generic hidraw would be excellent. It keeps everything sled contained.

Before making any changes I'd like to understand how the home button works a bit better. When possible, we want to make sure guide chords are available. If the current configuration skips a beat for holding the button, it might be preferable to suppress the win+d instead.

@khasburrahman

Copy link
Copy Markdown
Author

@pastaq Thanks for the suggestion!
Unfortunately I checked the home button can't register prolonged hold, so guide chords can't be done. Here's the button evtest reading.

I tested suppressing the at-keyboard win+d register, it doesn't able to do guide chords.
In that case it's better to map the win+d to guide button, so the press register immediately.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants