Forums > Jitter

mouseup detection in jit.pwindow

May 30, 2008 | 3:54 pm

hi

I need to detect a mouseup in a jit.pwindow when I rotate a jit.gl.videoplane (it could be any gl thing really). I’m unsure should I be doing this at the jit.pwindow, jit.gl.handle or jit.gl.videoplane? jit.pwindow has mouse movement detection while active and idle but I can’t see any means of checking clicks. I was hoping there might be an output mode (as there is for a waveform) which I might be able to use but can’t find anything like that.

If you need to see code, just open the jit.gl.handle help patch, I’m essentially working on the same thing.

Thanks in advance.

a+
gar


May 31, 2008 | 2:14 pm

The mouse information from a pwindow includes when the mouse button is released. The first number after the x/y coordinates shows the mouse button state, so checking from a 1 to 0 transition shows when the mouse goes up.

Here’s a patch:

– Pasted Max Patch, click to expand. –

May 31, 2008 | 4:49 pm

hi

Yes found it, thanks for your help (although I don’t have max 5 so unsure how to read the file). This is what I did which I guess is similar?

a+
gar

max v2;
#N vpatcher 10 59 596 593;
#P button 118 372 58 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 118 351 58 196617 r 3dupdate;
#P window setfont "Gill Sans" 10.;
#P comment 435 405 109 278003722 Retrieve mouseups only;
#P window setfont "Sans Serif" 9.;
#P newex 435 363 46 196617 TogEdge;
#P newex 435 386 90 196617 forward 3dupdate;
#P newex 435 340 76 196617 unpack 0 1 2 3;
#P user jit.pwindow 116 84 330 248 0 1 0 1 1 1;
#X name preview;
#P connect 5 0 6 0;
#P connect 0 1 1 0;
#P fasten 1 3 3 0 506 360 440 360;
#P fasten 3 1 2 0 476 383 440 383;
#P pop;


Viewing 3 posts - 1 through 3 (of 3 total)