I've written a python program that uses gphoto2 to control my camera - so I can create a photobooth. Instead of offering the user a keyboard or mouse for input I've bought an xin-mo controller so I can provide a simple arcade style button interface (take photo, reject photo, accept photo etc).
The python program is written using Tkinter and I'm using evdev to read the input events from the xin-mo. The code I'm using for the xin-mo events is like so:-
while True:
for ev in device.read():
print("Take photo")
It works and I can do something when the buttons are pressed.
What I can't figure out is how do I get evdev and Tkinter to work together. From what I've found I need to call mainloop to render the GUI... but once in the mainloop how do I read input events from the xin-mo controller??
I'm very new to python, so I may well be missing something obvious.
Thanks, Steve.