Skip to content

Commit e710162

Browse files
committed
add oxp controller setting for g1 touch keyboard vibration
typo
1 parent 543cfcd commit e710162

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

src/hhd/device/oxp/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ def settings(self) -> HHDSettings:
110110
# Maybe it is helpful for OneXFly users
111111
# del base["controllers"]["oxp"]["children"]["swap_face"]
112112

113+
if not self.dconf.get("g1", False):
114+
del base["controllers"]["oxp"]["children"]["vibrate_on_press"]
115+
113116
if not self.turbo:
114117
del base["controllers"]["oxp"]["children"]["extra_buttons"]
115118
del base["controllers"]["oxp"]["children"]["turbo_reboots"]

src/hhd/device/oxp/base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
X1_MINI_PAGE = 0xFF00
4040
X1_MINI_USAGE = 0x0001
4141

42+
G1_KEYBOARD_VID = 0x6080
43+
G1_KEYBOARD_PID = 0x8060
44+
4245
XFLY_VID = 0x1A2C
4346
XFLY_PID = 0xB001
4447
XFLY_PAGE = 0xFF01
@@ -493,14 +496,14 @@ def controller_loop(
493496
)
494497
# Touchpad keyboard
495498
d_kbd_2 = GenericGamepadEvdev(
496-
vid=[0x6080],
497-
pid=[0x8060],
499+
vid=[G1_KEYBOARD_VID],
500+
pid=[G1_KEYBOARD_PID],
498501
required=True,
499502
grab=False,
500503
btn_map=BTN_MAPPINGS,
501504
capabilities={EC("EV_KEY"): [EC("KEY_D")]},
502505
requires_start=True,
503-
vibrate_on_press=0.008,
506+
vibrate_on_press=0.008 if conf["vibrate_on_press"].to(bool) else 0,
504507
)
505508

506509
share_reboots = False

src/hhd/device/oxp/controllers.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,10 @@ children:
7171
hint: >-
7272
Swaps A with B and X with Y.
7373
default: False
74+
75+
vibrate_on_press:
76+
type: bool
77+
tags: [ non-essential ]
78+
title: Vibrate on Press (Touch keyboard)
79+
hint: "Vibrate when typing on touch keyboard."
80+
default: True

0 commit comments

Comments
 (0)