Registration of all cocoa events?
I am doing usability testing and want to log all user input events: mouse movements, clicks, drags and keyboard input. I won't be able to figure out how, or find any code to do this. Any hints? I've looked at the CoreGraphics EventTap engines, but I'm worried it will be too low; I would like to know which UI elements the user clicks.
Edit to clarify:
I am doing usability testing, so I want to keep track of which parts of the interface the user is using and not using. So, I want to track the "Button" foo, was clicked 7 times on these specific timestamps, the user scrolled through this list and selected such and such an item "and so on.
a source to share
If you just want to track them for your application, you can override -[NSApplication sendEvent:]
. It is responsible for sending all events received by your application to the appropriate responders.
a source to share
I think you need to do a lot of swizzling .
Try swizzling first tryToPerform:with:
; If that does not work, you will need to use techniques such as mouseDown:
, mouseUp:
, drag and drop events keyDown:
, keyUp:
and undocumented methods gestures .
One of the complications with the latter solution is that you will have to use these methods not only for NSResponder, but also for several of its subclasses, since many class classes provide their own implementations that may or may not call their ancestors. '
a source to share
This is not at all what you are currently thinking about, but consider Silverback if you haven't already.
a source to share