mouse move event detected with no mouse movement?!? 
Author Message
 mouse move event detected with no mouse movement?!?

Hello all,

I was writing a 'screen-saver' type program where I want the demo to be
interrupted by the user through any kind of input (eg. keypress, mousemove
etc.).  

In the (only) form in the program I made a Sub Form_MouseMove subroutine that
basically stopped the demo.  However, when I run the code the demo starts, but
stops immediately (trace tells me that it is percievig a MouseMove event).  I
ran the program using only keysstrokes to ensure that there was not 'residual'
mouse movement and the same thing happened.  

Any suggestions?

mark



Fri, 19 Sep 1997 03:00:00 GMT  
 mouse move event detected with no mouse movement?!?
hi,

Quote:
> I was writing a 'screen-saver' type program where I want the
> demo to be interrupted by the user through any kind of input
> (eg. keypress, mousemove etc.).
> In the (only) form in the program I made a Sub Form_MouseMove
> subroutine that basically stopped the demo. However, when I run
> the code the demo starts, but stops immediately (trace tells me
> that it is percievig a MouseMove event).

Yep, i had the same problem. The MouseMove event is triggered when loading
the form. It sometimes even get's triggered when Timer controls are
enabled. Very weird.

This is my sollution :

Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As
Single)

  Static iCount As Integer
  Static iX As Integer, iY As Integer

  '
  ' Count MouseMove events
  '
  iCount = iCount + 1

  '
  ' If this is the second MouseMove event
  '
  If iCount = 2 Then

    '
    ' If the mouse pointer actually moved,
    ' End the screen saver
    '
    If iX <> X Or iY <> Y Then
      Unload Me
    End If

    iCount = 0

  End If

  '
  ' Save the current mouse pointer coordinated
  '
  iX = X
  iY = Y

End Sub

Bye Jan...



Sat, 20 Sep 1997 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Detecting Mouse Movement BEFORE Cursor Moves?

2. Detecting Mouse Movement BEFORE Cursor Moves?

3. Detecting Mouse Movement BEFORE Cursor Moves?

4. move a mouse pointer to a different location without moving the mouse

5. Capturing Mouse Movement BEFORE Cursor Moves????

6. Capturing Mouse Movement BEFORE Cursor Moves????

7. Capturing Mouse Movement BEFORE Cursor Moves????

8. Detect Mouse Movements

9. Detecting mouse movement for all forms at once

10. Help needed - detecting mouse movement

11. Detecting mouse movement over a MCIWNDX.VBX ??

12. Detect mouse movement or key press in VBS ?

 

 
Powered by phpBB® Forum Software