remote-evdev-python/test-evdev.py
2022-07-21 21:23:47 +02:00

36 lines
655 B
Python
Executable File

#!/usr/bin/env python3
import evdev
import sys
import glob
def test_uinput():
_uinput = evdev.UInput({}, name="test")
def test_input_device():
possible_devices = glob.glob("/dev/input/event*")
devices = evdev.list_devices()
for device in possible_devices:
if device not in devices:
print(f"Missing permissions for {device}")
def main():
args = sys.argv
args.append("")
match args[1]:
case "host":
test_input_device()
case "guest":
test_uinput()
case _:
test_input_device()
test_uinput()
if __name__ == "__main__":
main()