0

My question is essentially the same as the one found here:

Performing a double click using CGEventCreateMouseEvent()

However, I have tried both of the solutions provided and neither of them works for me. I can perform mouse moves and single clicks but the double click has me stumped.

Any ideas on where I can go from here?

Community
  • 1
  • 1
Derek Nowicki
  • 283
  • 5
  • 16
  • Are you posting the events from a normal application? Are you sending them to the same application, or a different one, and in the latter case, is it the front application? – JWWalker May 22 '14 at 05:23
  • Right now I'm just running some test code in XCode. When I do a single-click function I can move the pointer to a spot on the project navigator (say at 220x200 where my Products folder is shown) and post a kCGEventLeftMouseDown and then kCGEventLeftMouseUp and it will actually select that folder as if I had done it myself with my mouse. Xcode is the active window and it is maximized in size. It stands to reason that if I follow the code example to set up a double click, it should behave similarly to a double click with a mouse. the pointer moves, but the clicks seem to be not going through – Derek Nowicki May 22 '14 at 05:42
  • I think I almost have it now. What I did was set up my demo program to do a single click on one point of the Xcode window, sleep 1 second and then double click on a different place. This time I'm doing it in the editor window so the double click highlights a word of text, just as if I did it with a mouse. Not sure why it would need that, I'm guessing it has something to do with making the window the focus before the double click? – Derek Nowicki May 22 '14 at 06:56

0 Answers0