How to simulate low level keyboard/mouse event on osx

612 Views Asked by At

I have tried to use Applescript to simulate a keyboard event

tell application "System Events"
    keystroke "This is a test"

and use Quartz event service

CGEventRef e = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)52, true);
CGEventPost(kCGSessionEventTap, e);
CFRelease(e);

However, none of these methods are actually creating low level HID input events (IOHIDSystem "HIDIdleTime" was not reset)

0

There are 0 best solutions below