From 8e689c26f87fcd790f2b738635b2ecda2726a523 Mon Sep 17 00:00:00 2001 From: James Hurst Date: Fri, 8 Aug 2014 22:09:59 -0400 Subject: [PATCH] Wait 0.1s between the keydown and keyup event I observed an issue where when autotyping into the Steam client the tab key wouldn't register. Adding a 0.1s delay between the keydown and keyup events seems to gives the application enough time to register the key press. --- MacPass/MPAutotypeCommand.m | 1 + 1 file changed, 1 insertion(+) diff --git a/MacPass/MPAutotypeCommand.m b/MacPass/MPAutotypeCommand.m index 16175496..58632833 100644 --- a/MacPass/MPAutotypeCommand.m +++ b/MacPass/MPAutotypeCommand.m @@ -196,6 +196,7 @@ /* Send the event */ CGEventPost(kCGSessionEventTap, pressKey); + usleep(100000); CGEventPost(kCGSessionEventTap, releaseKey); CFRelease(pressKey);