I need to simulate keyPress on my Qt application (I'm on mac Os X 10.6).
I wrote this code:
#include <ApplicationServices/ApplicationServices.h>
...
CGEventRef mkey = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)46, true);
CGEventPost(kCGAnnotatedSessionEventTap, mkey);
CFRelease(mkey);
...
But there is an error:
Undefined symbols:
"_CGEventCreateKeyboardEvent", referenced from:
SimuleEvent::PressControl(QString) in simuleevent.o
"_CGEventPost", referenced from:
SimuleEvent::PressControl(QString) in simuleevent.o
"_CFRelease", referenced from:
SimuleEvent::PressControl(QString) in simuleevent.o
I think I have to link a library but I don't know which ?
Thank you
Nico