Thanks for the reply David.
I tried to hack a Carbon sample from the Developer samples (I've never done Carbon before, so I didn't even know how to hook up an event handler), and I think I replicated my previous code in a Carbon app. I achieved the same results. I basically got it to wait for 2 seconds (using a CFTimerRef), do a mouse-down with CGPostMouseEvent(), wait 3 more seconds, and then do a mouse-up with CGPostMouseEvent(). Again it doesn't seem to work for me. I am coding this on a Powerbook without an external USB mouse (using the trackpad)....do you think that would have anything to do with it?
I've downloaded your trial versions of Keystrokes and Switch XS...very impressive stuff. However, I think it is a bit overkill for what my friend needs. She is not that adept at computing, and I just wanted to give her something simple to do clicking and dragging with her head mouse (she is mostly into games and stuff that doesn't require key input). It's also kinda of a personal thing where it'd be cool that I was able to actually code something to help her out. It doesn't have to be commercial quality or anything, just something she can use.
I noticed that in your two programs (Keystrokes and Switch XS), each have a drag function. However, they act differently. You seem to have figured out how to do the drag correctly with Keystrokes, but when I try it with Switch XS I get the same behaviour as my code. The drag does work in Switch XS if I do it completely with the joystick (i.e. I emulate the mouse moves as well), but not when I do the simulated drag-click and then the physical movement of the trackpad.
- Andrew
David Niemeijer <email@hidden> wrote:
All that said, I can tell you from my own experience that synthetic drags can be done with just the CGPostMouseEvent API, no need to use IOHIDPostEvent. What exactly is going wrong for you I do not know, but in Carbon I got it working. I think also SamrtClick was done in Carbon but I am not 100% sure.