1

I would like to read the touchpad input from /dev/input/eventX. Although many questions ( Get mouse deltas using Python! (in Linux) ) answer how to do so, they do not quite answer how to convert the data obtained into integer form.

It is not obvious to me how to convert them. And also how does one write into a eventX file. Please help me!

Python code that I am currently using :

file = open("/dev/input/event1","rb")
while 1:
  buf = file.read(16)
  print buf

EDIT: I am aware of tools like xdotool that do this, but I really need it in the code form.

Community
  • 1
  • 1
256ABC
  • 143
  • 4

0 Answers0