Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/hhd/device/claw/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import re
import select
import time
from threading import Event as TEvent
Expand Down Expand Up @@ -54,6 +55,9 @@
KBD_VID = 0x0001
KBD_PID = 0x0001

MSI_WMI_VID = 0x0000
MSI_WMI_PID = 0x0000

BACK_BUTTON_DELAY = 0.1
BUTTON_MIN_DELAY = 0.13

Expand Down Expand Up @@ -447,6 +451,17 @@ def controller_loop(
**(extra_args if use_dinput else {}),
)

d_msi_wmi = MsiAtKbd(
vid=[MSI_WMI_VID],
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not unique, can you bind to "MSI *" name as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not unique, can you bind to "MSI *" name as well?

Name matching added

pid=[MSI_WMI_PID],
name=[re.compile("^MSI.+")],
required=False,
grab=True,
capabilities={EC("EV_KEY"): [EC("KEY_F15")]},
btn_map=dconf.get("btn_mapping", MSI_CLAW_MAPPINGS),
)


d_kbd_1 = MsiAtKbd(
vid=[KBD_VID],
pid=[KBD_PID],
Expand Down Expand Up @@ -537,6 +552,7 @@ def prepare(m):
prepare(d_xinput)
prepare(d_volume_btn)
prepare(d_kbd_1)
prepare(d_msi_wmi)
if not test_mode:
prepare(d_kbd_2)
prepare(d_mouse)
Expand Down Expand Up @@ -578,6 +594,7 @@ def prepare(m):

# Read delayed events
evs.extend(d_kbd_1.produce([]))
evs.extend(d_msi_wmi.produce([]))

evs = multiplexer.process(evs)
if evs:
Expand Down