473,378 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

raise mouse event on timer?

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?

Feb 27 '07 #1
3 5149
On Feb 27, 10:29 am, "wanwan" <ericwa...@yahoo.comwrote:
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

Feb 28 '07 #2
On Feb 27, 10:00 pm, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Feb 27, 10:29 am, "wanwan" <ericwa...@yahoo.comwrote:
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
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

Mar 2 '07 #3
On Mar 2, 3:45 am, "wanwan" <ericwa...@yahoo.comwrote:
On Feb 27, 10:00 pm, "rowe_newsgroups" <rowe_em...@yahoo.comwrote:
On Feb 27, 10:29 am, "wanwan" <ericwa...@yahoo.comwrote:
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

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

Mar 2 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dan Cimpoiesu | last post by:
I have a remoting object, derived from MarshalByRefComponent, that I instantiate on the client side, with Activator.GetObject. Can I receive events fired on the server, on the client? How?
12
by: Vittorio Pavesi | last post by:
Hello, is it possible to manually raise the event Elapsed of the timer object ? Vittorio
5
by: Just Me | last post by:
Often I have a problem like the following: .. This is the way I think things happen is: If the usercontrol raises the event when it is first created (I.e., in it's New, or in it's Enter event,...
2
by: scott_gui | last post by:
I am creating a Windows application: The mouse event <Double-Button-1> has a conflict when the <Button-1> event also has a binding. Double clicks will first perform the single click action. This...
2
by: Ryan Liu | last post by:
Hi, I need the MouseDown event be trigged everytime when you press mouse in a datagrid (System.Windows.Forms). But seems mouse event will only fire once, and it seems changed to edit mode...
0
by: lechatthierry | last post by:
Is it possible to block a mouse event on an Hyperlink with a general script event? This is quite troublesome for me. I am trying to find a way to block the windows shortcut SHIFT + MOUSE LEFT...
1
by: Neko | last post by:
Is it possible to block a mouse event on an Hyperlink with a general script event? This is quite troublesome for me. I am trying to find a way to block the windows shortcut SHIFT + MOUSE LEFT...
3
by: =?Utf-8?B?Ulc=?= | last post by:
I constructed a new Class with some private members. I would like an event to be raised on the moment the value of one of those private members is changed. How do I define an event for that...
5
by: Mike | last post by:
Hi group; Let say I have an object called Account, that raises an event called AccountLow with its owns EventArgs, and when this event gets raised, I will like to raise another custom...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.