View Single Post
Old 3rd August 2008, 11:27   #272
Mr_Nudge
Major Dude
 
Mr_Nudge's Avatar
 
Join Date: Apr 2004
Location: melbourne, australia
Posts: 655
not sure if anyone comes round here that often anymore, but nevertheless, here's some nifty code i made for mouse control.

//frame

gmx=getkbmouse(2);
gmy=getkbmouse(1);
gmc=getkbmouse(3);
mos=below(abs(gmx),1)*below(abs(gmy),1);
gmc2=if(mos*gmc,1,if(bnot(gmc),0,gmc2));
gmc3=if(bnot(gmc2)*bnot(mos),0,if(bnot(gmc)*mos,1,gmc3));
os=gmc2*gmc3;

--

basically, os returns 1 when you left click on the avs window and will keep returning 1 as long as the left mouse button is held, even if the mouse moves off the window.

os will return 0 at all other times, even if the left mouse button is held then dragged onto the avs window.

Life's a game, break the rules
Click here
Mr_Nudge is offline   Reply With Quote