Mouse in LCD ?

Feb 23, 2008 at 1:31pm

Mouse in LCD ?

How can I know if the user’s mouse is in an [LCD] ?
I’d like to receive 1 or BANG while it’s in and 0 while it’s out.

I’d like to avoid the use of [mousestate].

I use this technique for now, but it’s not satisfying.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 99 285 50 9109513 unpack;
#P button 187 249 103 0;
#P user lcd 60 78 128 153 1 1 1 0 0;
#P newex 99 371 40 9109513 t b;
#P newex 99 345 40 9109513 change;
#P window setfont “Sans Serif” 20.;
#P comment 220 132 457 9109524 Move the mouse in the LCD and look at the BANG;
#P connect 1 0 2 0;
#P connect 3 1 5 0;
#P connect 5 0 1 0;
#P connect 5 1 1 0;
#P fasten 2 0 4 0 104 404 156 404 156 240 192 240;
#P window clipboard copycount 6;

If you have any other idea, don’t hesitate.

#36006
Feb 23, 2008 at 2:26pm

This example is with mousestate, but it is not used to report actual position, but simply activity. So no messy stuff. It kind of works, but might need some tweaking here and there.

_
johan

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N vpatcher 20 74 346 479;
#P window setfont “Sans Serif” 9.;
#P newex 56 175 21 196617 t 0;
#P newex 34 199 40 196617 change;
#P newex 34 126 45 196617 t 1 stop;
#P newex 56 156 38 196617 del 32;
#P newex 34 105 45 196617 onebang;
#P newex 49 50 30 196617 t b b;
#P newex 28 50 20 196617 t b;
#P newex 43 84 36 196617 buddy;
#P inlet 49 30 15 0;
#P inlet 28 30 15 0;
#P outlet 34 221 15 0;
#P connect 1 0 4 0;
#P connect 5 0 6 0;
#P connect 6 0 8 0;
#P connect 10 0 9 0;
#P connect 8 0 9 0;
#P connect 9 0 0 0;
#P connect 4 0 3 0;
#P connect 2 0 5 0;
#P connect 6 1 7 0;
#P connect 8 1 7 0;
#P connect 7 0 10 0;
#P connect 5 1 3 1;
#P connect 3 1 6 1;
#P pop;
#P newobj 347 359 52 196617 p active?;
#P toggle 347 378 15 0;
#P user lcd 308 199 128 153 1 1 1 0 0;
#N vpatcher 20 74 346 479;
#P window setfont “Sans Serif” 9.;
#P newex 56 175 21 196617 t 0;
#P newex 34 199 40 196617 change;
#P newex 34 126 45 196617 t 1 stop;
#P newex 56 156 38 196617 del 32;
#P newex 34 105 45 196617 onebang;
#P newex 49 50 30 196617 t b b;
#P newex 28 50 20 196617 t b;
#P newex 43 84 36 196617 buddy;
#P inlet 49 30 15 0;
#P inlet 28 30 15 0;
#P outlet 34 221 15 0;
#P connect 1 0 4 0;
#P connect 5 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 9 0;
#P connect 10 0 9 0;
#P connect 9 0 0 0;
#P connect 4 0 3 0;
#P connect 2 0 5 0;
#P connect 8 1 7 0;
#P connect 6 1 7 0;
#P connect 7 0 10 0;
#P connect 5 1 3 1;
#P connect 3 1 6 1;
#P pop;
#P newobj 217 359 52 196617 p active?;
#P toggle 217 378 15 0;
#P newex 480 334 64 196617 speedlim 33;
#P message 466 298 24 196617 poll;
#P newex 466 315 66 196617 mousestate;
#P user lcd 178 199 128 153 1 1 1 0 0;
#P comment 498 299 100 196617 start mouse;
#P fasten 4 0 6 1 485 355 264 355;
#P fasten 4 0 9 1 485 355 394 355;
#P connect 7 1 9 0;
#P connect 9 0 8 0;
#P connect 1 1 6 0;
#P connect 6 0 5 0;
#P connect 2 1 4 0;
#P connect 3 0 2 0;
#P window clipboard copycount 10;

#123325
Feb 23, 2008 at 3:13pm

Thank you Johan for this great idea.
The tweaked patch…

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 135 195 50 9109513 loadbang;
#P button 207 103 53 0;
#P newex 67 467 19 9109513 t 0;
#P newex 150 254 63 9109513 speedlim 100;
#P message 135 215 50 9109513 poll;
#P toggle 207 31 53 0;
#P newex 67 215 50 9109513 change;
#P newex 150 275 50 9109513 change;
#P user lcd 67 22 128 153 1 1 1 0 0;
#P newex 135 233 70 9109513 mousestate;
#P newex 19 535 40 9109513 change;
#P newex 19 405 40 9109513 t 1 stop;
#P newex 67 443 38 9109513 del 1;
#P newex 19 371 58 9109513 onebang;
#P newex 150 296 52 9109513 t b b;
#P newex 67 268 20 9109513 t b;
#P newex 67 317 93 9109513 buddy;
#P connect 16 0 12 0;
#P connect 4 0 14 0;
#P connect 3 1 4 0;
#P connect 5 1 4 0;
#P connect 7 1 13 0;
#P connect 13 0 9 0;
#P connect 10 0 1 0;
#P connect 8 1 10 0;
#P connect 8 0 10 0;
#P fasten 6 0 11 0 24 573 291 573 291 22 212 22;
#P connect 11 0 15 0;
#P connect 9 0 2 0;
#P connect 14 0 6 0;
#P connect 5 0 6 0;
#P connect 3 0 5 0;
#P connect 2 0 0 1;
#P fasten 2 1 3 0 197 344 24 344;
#P lcolor 7;
#P connect 0 0 3 1;
#P connect 1 0 0 0;
#P connect 12 0 7 0;
#P window clipboard copycount 17;

#123326

You must be logged in to reply to this topic.