Skip to content
Advertisement

How to send actions directly to input event?

I have a touch screen with events at /dev/input/event12 and /dev/input/event13. /dev/input/event12 is the main touch input, and in essence, I’d like to send instructions to the event directly to control behavior (ie, click location etc).

Tools like xdotool do not want to work because this device is being set as a second pointer (see: https://dwm.suckless.org/multi-pointer/) and the recommendation of using xinput set-cp <window> <master> does not appear to work as expected.

Advertisement

Answer

A solution was found using Python and Python-evdev. Using evdev you can assign the device and pass parameters within the allowed functions. In my case it is as follows:

device.write(e.EV_KEY, e.BTN_TOUCH, 1) device.write(e.EV_KEY, e.BTN_TOUCH, 0) device.write(e.EV_SYN, 0, 0)

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement