Skip to content

Enhance device discovery with handler for name matching failures#8

Open
JerryJohnsonLee wants to merge 1 commit intobahaaador:mainfrom
JerryJohnsonLee:main
Open

Enhance device discovery with handler for name matching failures#8
JerryJohnsonLee wants to merge 1 commit intobahaaador:mainfrom
JerryJohnsonLee:main

Conversation

@JerryJohnsonLee
Copy link
Copy Markdown

relies on handler when name based matching fails

relies on handler when name based matching fails
Copy link
Copy Markdown
Owner

@bahaaador bahaaador left a comment

Choose a reason for hiding this comment

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

Thanks so much for your contribution, @JerryJohnsonLee.

I’ll need to find some time to test this, but one thought that comes to mind is whether this might produce unexpected results if other devices are picked up. For example, a power button could have a handler like:

I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=PNP0C0C/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=3
B: KEY=8000 10000000000000 0

In that case it might match as a keyboard.

Curious to hear your thoughts on that. Could you tell me a bit more about your use case? What name was showing up for the device on your system?

@bahaaador bahaaador self-assigned this Mar 14, 2026
@JerryJohnsonLee
Copy link
Copy Markdown
Author

Thanks so much for your contribution, @JerryJohnsonLee.

I’ll need to find some time to test this, but one thought that comes to mind is whether this might produce unexpected results if other devices are picked up. For example, a power button could have a handler like:

I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=PNP0C0C/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=3
B: KEY=8000 10000000000000 0

In that case it might match as a keyboard.

Curious to hear your thoughts on that. Could you tell me a bit more about your use case? What name was showing up for the device on your system?

Yeah for my case I have a logi mouse displayed as "Logitech MX Master 3S" and my keyboard is named as "Majestouch Convertible 2", neither of which contains the "mouse" or "keyboard" keyword, so I have to rely the handler to recognize the device. As for your case, do you think "Power" will be a keyword sufficient to differentiate a power button? In that case we could filter out those containing "Power" in name

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