map TUIO 2DCur to active window
I've got a multitouch touchscreen driver sending TUIO 2DCur events with normalized (0. to 1.) x, y, X and Y coordinates covering the screen area.
I've got a maxpatcher window with a fader.
Now, how do I know wether a TUIO x/y is in/out that fader? How do I map the TUIO normalized coordinates to the maxpatcher window? How do I know the coordinates/size of the maxpatchers window area? or the faders area?
Tabsel
In GL context is simlple:
Use "screentoworld" and "worldtoscreen" messages - send them to [jit.gl.render] to convert coords between GL units and position inside the window (the position is expressed in pixels).
But in "ordinary" patcher window you have to calc position of your slider (patcher window position + slider position) and convert TUIO coords to screen coords (multiply TUIO x and y coord by horizontal and vertical resolution).
Ah, ok, thanks, completely new to jitter...
Say, I've got two screens attached to my MacBookPro, the laptops retina (A) and the external touch screen (B). Both screens may be arranged in any form.
I now want to use the touchpanel of B like the MacBooks builtin trackpad concerning relative mouse movement using TUIO client, converting X/Y to mouse movement using aka.mouse, right?
Do I have to cater for the screen arrangement or will aka.mouse's forwarding of mousemovement to the OS cater for that?
When a dedicated TUIO gesture is detected, a maxpatcher comprising a (scalable) "virtual Mackie Control Unit" (vMCU) shall be opened/closed. Using jit.gl.render screentoworld/worldtoscreen I would be able to convert TUIO x/y to vMCU UI controls, no matter the position/size of the maxpatcher, right? TUIO events outside the maxpatcher window could further be interpreted as trackpad emulation.
Seems possible, doesn't it?