Touch screen handle in Tkinter

How do I go about installing a touchscreen gesture handler in Tkinter?

I need something particularly simple: increase the font size whenever the 'expand' gesture is detected.

Is it possible to do this in Tkinter if Tcl / Tk doesn't specifically implement it? I suppose that either the window manager dispatches an event to the client window that I could listen for and handle, or the client has to register with the window manager with a handler for a specific type of event, but if it is not possible to register these handlers from Tkinter and if Tcl does not provide for them interface, I don't see a way that I could do this.

+3


source to share


1 answer


Tk does not support complex touch events at the moment, and MSDN is very subtle about what they actually look like when they enter an event loop. (This seems to be not what you should be looking at). Since Tk intercepts this data at a very low level, it will be difficult to integrate.

I cannot pursue this any further. I can see some code working, but the way the samples in the MSDN function are not at all the same as what Tk is doing. There's a whole structure of mismatch between them. (I also don't have a device that supports these features: my touch devices didn't start Windows, and my Windows devices don't support touch.)



We need someone with a Win 8 touch system to run a Tk app that has been cracked ( Tk_TranslateWinEvent()

in win/tkWinX.c

would be the right place) to print unrecognized events. Then we could see what actually happens through the wire (well, through the main communication pump) with touch events; we can hope that they correspond to things related to ManipulationStarted

, ManipulationUpdated

and ManipulationCompleted

, but hope is not always enough. (We can also hope that events do not travel through a different route.)

+2


source







All Articles