I have a little project needing a GUI that I am writing for the Pi 2 with the official 7" ouchscreen. Although there are OF addons to get the touchscreen data out, these don’t integrate with any of the GUI addons I have seen, linking their mouse move & click events to the triggers for things like button presses and slider drags.
Does anyone have a favourite way around this? Currently I am manually trapping touchscreen events and categorising them (as I can’t see how to emulate mouse events and pass them directly to the GUI handlers) but if anyone could point me in a more sensible direction I would be most grateful!
It’s actually your addon that I am using already! As far as I can see, the official RPi display driver interfaces with X, but not directly to the OS itself - that is to say I can move the mouse pointer in Raspbian, but not when running an OF app.
I’m not sure I understand from your reply how to send an OS-level mouse event that will get picked up in an OF app. Would you mind elaborating a bit to help my slow brain out?
for example using the pressure coordinates (touch.getCoordTouch().z) of addons ofxTFTTouch, you can activate the XWrapPointer event where the last two parameters (X, Y mouse) you pass here the coordinates taken by ofxTFTTouch “touch.getCoordTouch().x, touch.getCoordTouch().y”.
The project I was working on never went further than POC so I would have to dig it out and clean it up. The method I used was based off @kashim’s code 5 posts up from this one.