I found that reading INSIDE of the loop can miss events. In fact, no clicks are read inside of them if you read them after the loop!
DO DO WHILE _MOUSEINPUT loop& = loop& + 1 IF _MOUSEBUTTON(1) THEN PRINT "Read"; loop&; 'never reads LOOP IF _MOUSEBUTTON(1) THEN 'current button state PRINT "DOWN"; loop&; ELSE PRINT " UP "; loop&; END IF Readmouse LOOP SUB Readmouse STATIC loops& DO WHILE _MOUSEINPUT IF _MOUSEBUTTON(1) THEN PRINT "down1"; loops& ELSE PRINT "up1"; loops& 'never reads loops& = loops& + 1 LOOP IF _MOUSEBUTTON(1) THEN PRINT "down2"; loops& ELSE PRINT "up2"; loops& 'current state END SUB There is STILL the possibility that something is missed. This is indicated when a loop count doesn't change. COMMENT out the reads AFTER the loops and see what happens when reading INSIDE of the loop ONLY... WOW! Ted
|