raise mouse event on timer?

W

wanwan

I made a game with a window form that needs to record the mouse
position to an array at 100 samples per second, so I use the mouse
move event to do the job.

The problem is the mouse move event is raised by my software at max 30
times per second. I have determined I should use a timer event on
every 10 msec to raise the mouse event, but then I need the same mouse
event that is sent to the mouse move function in the mouse move event

how do I get that event in my timer?
 
R

rowe_newsgroups

I made a game with a window form that needs to record the mouse
position to an array at 100 samples per second, so I use the mouse
move event to do the job.

The problem is the mouse move event is raised by my software at max 30
times per second. I have determined I should use a timer event on
every 10 msec to raise the mouse event, but then I need the same mouse
event that is sent to the mouse move function in the mouse move event

how do I get that event in my timer?


Why not use Cursor.Position inside the timer to the the screen
coordinates? This seems more efficient than calling the mousemover
event that often.

Thanks,

Seth Rowe
 
W

wanwan

Why not use Cursor.Position inside the timer to the the screen
coordinates? This seems more efficient than calling the mousemover
event that often.

Thanks,

Seth Rowe

I can't use screen coordinate because I'm tracking positions images in
the form in relation to the mouse position.... unless there is a way
to convert form coordinates to screen coordinates.

Please advise
 
R

rowe_newsgroups

I can't use screen coordinate because I'm tracking positions images in
the form in relation to the mouse position.... unless there is a way
to convert form coordinates to screen coordinates.

Please advise

PointToClient(Cursor.Position)

Thanks,

Seth Rowe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top