J'ai besoin de simuler keypress sur mon application Qt (je suis sur mac Os X 10.6).Utiliser CGEvent avec Qt sur Mac Os X
J'ai écrit ce code:
#include <ApplicationServices/ApplicationServices.h>
...
CGEventRef mkey = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)46, true);
CGEventPost(kCGAnnotatedSessionEventTap, mkey);
CFRelease(mkey);
...
Mais il y a une erreur:
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
Je pense que je dois lier une bibliothèque, mais je ne sais pas qui?
Merci
Nico