mirror of
https://github.com/sezanzeb/input-remapper
synced 2024-11-12 01:10:38 +00:00
test for getdevices ignoring evdev.UInput stuff from key-mapper
This commit is contained in:
parent
beee72431f
commit
0abd5b60c4
@ -61,6 +61,10 @@ class _GetDevicesProcess(multiprocessing.Process):
|
||||
# "Logitech USB Keyboard" and "Logitech USB Keyboard Consumer Control"
|
||||
grouped = {}
|
||||
for device in devices:
|
||||
if device.phys.startswith('key-mapper'):
|
||||
# injector device, not really periphery
|
||||
continue
|
||||
|
||||
# only keyboard devices
|
||||
# https://www.kernel.org/doc/html/latest/input/event-codes.html
|
||||
capabilities = device.capabilities().keys()
|
||||
@ -80,7 +84,7 @@ class _GetDevicesProcess(multiprocessing.Process):
|
||||
if grouped.get(usb) is None:
|
||||
grouped[usb] = []
|
||||
|
||||
logger.debug('Adding %s', device.path)
|
||||
logger.debug('Found "%s", %s, %s', device.name, device.path, usb)
|
||||
|
||||
grouped[usb].append((device.name, device.path))
|
||||
|
||||
|
@ -108,6 +108,7 @@ class KeycodeInjector:
|
||||
|
||||
keymapper_device = evdev.UInput(
|
||||
name=f'key-mapper {device.name}',
|
||||
phys='key-mapper',
|
||||
events=capabilities
|
||||
)
|
||||
|
||||
|
@ -114,6 +114,14 @@ def patch_evdev():
|
||||
'phys': 'usb-0000:03:00.0-3/input1',
|
||||
'name': 'device 3'
|
||||
},
|
||||
|
||||
# key-mapper devices are also ignored, another instance of key-mapper
|
||||
# started injecting apparently.
|
||||
'/dev/input/event40': {
|
||||
'capabilities': {evdev.ecodes.EV_KEY: []},
|
||||
'phys': 'key-mapper/input1',
|
||||
'name': 'key-mapper device 2'
|
||||
},
|
||||
}
|
||||
|
||||
def list_devices():
|
||||
|
Loading…
Reference in New Issue
Block a user