PDA

View Full Version : simultaneous button down and mouse movement not working.




MACaveli7
Nov 4, 2010, 09:33 AM
Hi Guys. I'm using GetEventParameter to get the position of the mouse, however whenever I press a button it seems to stop processing the mouse movement.

I'm am using the function for mouse movement as follows:

GetEventParameter(Event, kEventParamWindowMouseLocation, typeHIPoint, NULL, sizeof(MousePos), NULL, &MousePos);

for mouse button presses.

GetEventParameter(Event, kEventParamMouseButton, typeMouseButton, NULL, sizeof(typeMouseButton), NULL, &uButtonPressed);

Thanks for your time.



gnasher729
Nov 4, 2010, 03:57 PM
Hi Guys. I'm using GetEventParameter to get the position of the mouse, however whenever I press a button it seems to stop processing the mouse movement.

I'm am using the function for mouse movement as follows:

GetEventParameter(Event, kEventParamWindowMouseLocation, typeHIPoint, NULL, sizeof(MousePos), NULL, &MousePos);

for mouse button presses.

GetEventParameter(Event, kEventParamMouseButton, typeMouseButton, NULL, sizeof(typeMouseButton), NULL, &uButtonPressed);

Thanks for your time.

Do you have a good reason to write Carbon code today?
And what events are you processing? Any dragging events?

MACaveli7
Nov 5, 2010, 04:38 AM
Do you have a good reason to write Carbon code today?
And what events are you processing? Any dragging events?

The code has been written in carbon, I'm not inclined to change it to cocoa since I'm unfamiliar with objective c, but I am open to ideas.

I am processing drag events, hence why I have the problem, unless you mean that there is a drag mouse event I have to use to get it to recognise simultaneous mouse movements and button presses.

robbieduncan
Nov 5, 2010, 05:25 AM
unless you mean that there is a drag mouse event I have to use to get it to recognise simultaneous mouse movements and button presses.

This was my first thought when I looked at your code but I never use Carbon so I can't really be sure.

MACaveli7
Nov 5, 2010, 09:21 AM
turns out you were right. There is a kEventMouseDragged event, it uses the same functionality as the mouse move event.

EventTypeSpec MouseHandlerEventsDrag[] = {kEventClassMouse, kEventMouseDragged};

InstallApplicationEventHandler(NewEventHandlerUPP(LeapardMouseEventDraggedHandler), 1, &MouseHandlerEventsDrag[0], this, NULL);

EventTypeSpec MouseHandlerEventsMove[] = {kEventClassMouse, kEventMouseMoved};

InstallApplicationEventHandler(NewEventHandlerUPP(LeapardMouseEventMovedHandler), 1, &MouseHandlerEventsMove[0], this, NULL);