Skip to content

Commit 9b97354

Browse files
authored
add MSI wmi device support (#227)
* add MSI wmi device support * add name match for msi wmi device
1 parent ed528ba commit 9b97354

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/hhd/device/claw/base.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import re
23
import select
34
import time
45
from threading import Event as TEvent
@@ -54,6 +55,9 @@
5455
KBD_VID = 0x0001
5556
KBD_PID = 0x0001
5657

58+
MSI_WMI_VID = 0x0000
59+
MSI_WMI_PID = 0x0000
60+
5761
BACK_BUTTON_DELAY = 0.1
5862
BUTTON_MIN_DELAY = 0.13
5963

@@ -447,6 +451,17 @@ def controller_loop(
447451
**(extra_args if use_dinput else {}),
448452
)
449453

454+
d_msi_wmi = MsiAtKbd(
455+
vid=[MSI_WMI_VID],
456+
pid=[MSI_WMI_PID],
457+
name=[re.compile("^MSI.+")],
458+
required=False,
459+
grab=True,
460+
capabilities={EC("EV_KEY"): [EC("KEY_F15")]},
461+
btn_map=dconf.get("btn_mapping", MSI_CLAW_MAPPINGS),
462+
)
463+
464+
450465
d_kbd_1 = MsiAtKbd(
451466
vid=[KBD_VID],
452467
pid=[KBD_PID],
@@ -537,6 +552,7 @@ def prepare(m):
537552
prepare(d_xinput)
538553
prepare(d_volume_btn)
539554
prepare(d_kbd_1)
555+
prepare(d_msi_wmi)
540556
if not test_mode:
541557
prepare(d_kbd_2)
542558
prepare(d_mouse)
@@ -578,6 +594,7 @@ def prepare(m):
578594

579595
# Read delayed events
580596
evs.extend(d_kbd_1.produce([]))
597+
evs.extend(d_msi_wmi.produce([]))
581598

582599
evs = multiplexer.process(evs)
583600
if evs:

0 commit comments

Comments
 (0)