Recording mouse movement

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Jakub
In need of some credit
In need of some credit
Posts: 6
Joined: Sat Mar 05, 2005 12:33 pm

Recording mouse movement

Post by Jakub » Sat Mar 05, 2005 12:52 pm

I apologized, if it is stupid question, but I didn't answer at this question:
I use wxMouseEvent with event.GetPosition():

EVT_MOTION(GraphCanvas::OnMotion)

....

void GraphCanvas::OnMotion(wxMouseEvent& event)
{
m_vector.push_back(event.GetPosition())
}

But if I move a little quicker, than I don't get all coordinates of move movement but just some. It seems, that window system don't send all events by moving, but just some. The processor seems to be idle by moving. How can I fix this?

Thank you for every answer.

Jakub Kulaviak

User avatar
Ryan Norton
Moderator
Moderator
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Re: Recording mouse movement

Post by Ryan Norton » Tue Mar 15, 2005 7:30 am

Jakub wrote:I apologized, if it is stupid question, but I didn't answer at this question:
I use wxMouseEvent with event.GetPosition():

EVT_MOTION(GraphCanvas::OnMotion)

....

void GraphCanvas::OnMotion(wxMouseEvent& event)
{
m_vector.push_back(event.GetPosition())
}

But if I move a little quicker, than I don't get all coordinates of move movement but just some. It seems, that window system don't send all events by moving, but just some. The processor seems to be idle by moving. How can I fix this?

Thank you for every answer.

Jakub Kulaviak
Part of the big patch from AOL added similar functionality to WX - if you like looking at patches, you can see it here http://sourceforge.net/tracker/?func=de ... tid=309863
[Mostly retired moderator, still check in to clean up some stuff]

Cursor
Earned some good credits
Earned some good credits
Posts: 120
Joined: Sun Aug 29, 2004 3:09 pm
Location: Grenoble, France
Contact:

Post by Cursor » Tue Mar 15, 2005 7:49 am

Yes, window system never send all pixels traversed.

As your class is name GraveCanva, I suppose that your goal is to render a and-draw picture. If it is that, if you draw a continuous line instead of alone pixels, it looks good (it is the mecansim of paint or all other picture hand drawing program).

In all case, make sure that your back-buffer (if you have one) is not too slow as client-rendering slow down mouse event frequency.

Jakub
In need of some credit
In need of some credit
Posts: 6
Joined: Sat Mar 05, 2005 12:33 pm

Post by Jakub » Tue Mar 15, 2005 10:45 am

Cursor wrote:Yes, window system never send all pixels traversed.

As your class is name GraveCanva, I suppose that your goal is to render a and-draw picture. If it is that, if you draw a continuous line instead of alone pixels, it looks good (it is the mecansim of paint or all other picture hand drawing program).

In all case, make sure that your back-buffer (if you have one) is not too slow as client-rendering slow down mouse event frequency.
Although it is not too exact, I will make it this way. Thanks.

Jakub

Post Reply