|
|
|
@ -22,6 +22,7 @@
|
|
|
|
|
"""Device and evdev stuff that is independent from the display server."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
import multiprocessing
|
|
|
|
|
import threading
|
|
|
|
|
import time
|
|
|
|
@ -168,6 +169,28 @@ def classify(device):
|
|
|
|
|
return UNKNOWN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DENYLIST = [
|
|
|
|
|
('Yubico', r'.*YubiKey.*')
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_denylisted(device):
|
|
|
|
|
"""Check if a device should not be used in key-mapper.
|
|
|
|
|
|
|
|
|
|
Parameters
|
|
|
|
|
----------
|
|
|
|
|
device : InputDevice
|
|
|
|
|
"""
|
|
|
|
|
for vendor, name in DENYLIST:
|
|
|
|
|
if not re.match(vendor, str(device.info.vendor), re.IGNORECASE):
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
if not re.match(name, str(device.name), re.IGNORECASE):
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class _GetDevices(threading.Thread):
|
|
|
|
|
"""Process to get the devices that can be worked with.
|
|
|
|
|
|
|
|
|
@ -217,6 +240,9 @@ class _GetDevices(threading.Thread):
|
|
|
|
|
# skip devices that don't provide buttons that can be mapped
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
if is_denylisted(device):
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
name = device.name
|
|
|
|
|
path = device.path
|
|
|
|
|
|
|
|
|
|