Click to See Complete Forum and Search --> : detecting key and mouse clicks inside a loop!?
Christopher
December 13th, 1998, 03:14 PM
Im trying to detect either a mouse click or a keypress while runing a for/next loop. is there a command that will allow me to check for such events while inside a loop.
for x=1 to infinity
'i want to check for a mouse or keypress here
next
as you probably know while aloop is running all operations suspend as far as
normal VB event go and they are not detected.
Thanks.
christopher
December 13th, 1998, 03:14 PM
Im trying to detect either a mouse click or a keypress while runing a for/next loop. is there a command that will allow me to check for such events while inside a loop.
for x=1 to infinity
'i want to check for a mouse or keypress here
next
as you probably know while aloop is running all operations suspend as far as
normal VB event go and they are not detected.
Thanks.
Crazy D
December 14th, 1998, 02:07 AM
Hi
First you need to insert DoEvents in the loop. This makes sure your program can process any messsages.
Second, you have to need a boolean to see if the mouse is clicked or a key is pressed (set it to true if it is -> do this in the Click and KeyDown events)
Check in the loop if the boolean is true.
This should work.
Hope this helps
Crazy D
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.