Window as EventTarget

doc

Registered
hmmm... while browsing the possibilities to install handlers for user-related inputs i tried to use a kEventMouseUp to install my handler upon. As the handler's target i took the app's window (there is only one). Done so, my handler gets the kEventMouseUp only when the mouse is pressed in the windows drag region/bar (i dont care, cause i actually just need it to get some user-controlled speed of the code while i debug it).
But... consider me doing some more sofisticated stuff; how can i get all the mouse events placed in the window's boarders relocated to the eventFunction? Do i have to use another target then the app's window?

...
EventTypeSpec eventSpec = {kEventClassMouse, kEventMouseUp};
...
EventTargetRef eventTarget_mainWindow = GetWindowEventTarget(windowRef_mainWindowRef);
InstallEventHandler(eventTarget_mainWindow, NewEventHandlerUPP(MyEventFunction), 1, eventSpec, &dummy, NULL);
RunApplicationEventLoop();
...

cheers doc
 
Back
Top