Skip to content

Commit f07541b

Browse files
committed
add ally check to avoid listening for fan key
1 parent 106c6bd commit f07541b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/hhd/plugins/overlay/controllers.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ def grab_buttons(fd: int, typ: int, btns: dict[int, str] | None):
196196
# ioctl(fd, EVIOCGMASK, data)
197197
# print(bytes(mask).hex())
198198

199+
def is_ally():
200+
try:
201+
with open("/sys/devices/virtual/dmi/id/product_name", "r") as f:
202+
product_name = f.read().strip().lower()
203+
return "ally" in product_name
204+
except Exception:
205+
return False
199206

200207
def find_devices(
201208
current: dict[str, Any] = {},
@@ -267,10 +274,10 @@ def find_devices(
267274
minor = cap & 0x07
268275

269276
# Only bind armoury to Asus WMI hotkeys
270-
if v == "armoury" and "Asus WMI hotkeys" not in dev.get("name", ""):
277+
if v == "armoury" and "Asus WMI hotkeys" not in dev.get("name", "") and not is_ally():
271278
continue
272279

273-
if v == "fan" and "asus" not in dev.get("name", "").lower():
280+
if v == "fan" and "asus" not in dev.get("name", "").lower() and not is_ally():
274281
continue
275282

276283
if len(keys) > major and keys[major] & (1 << minor):

0 commit comments

Comments
 (0)