Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MACaveli7

macrumors newbie
Original poster
Oct 15, 2010
23
0
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.
 
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?
 
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.
 
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);
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.