Simulating controller dpad button being held down with Python evdev
问题 I'm trying to simulate holding down a DPad button on a controller using Python evdev. So far I've managed to successfully press a button like so: import os import time from evdev import uinput, ecodes as e, list_devices, InputDevice, ff dev = InputDevice(str(os.path.realpath("/dev/input/by-id/usb-Sony_Interactive_Entertainment_Wireless_Controller-if03-event-joystick"))) dev.write(e.EV_ABS, e.ABS_HAT0X, 1) dev.write(e.EV_ABS, e.ABS_HAT0X, 0) dev.write(e.EV_SYN, 0, 0) but haven't been able to