Hi all,

I'm having this weird issue after upgrading iWork on Mountain Lion.
I wrote a small app to monitor and modify user's keystrokes, it works fine with other applications except latest version of Pages. Every time I send keyboard events with unicode strings contain 2-byte unicode characters, Pages will hang.

My code to simulate keystrokes is just simple like this:

CGEventRef KeyHandler(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon)
{

    ......

    CGEventRef keyEventDown = CGEventCreateKeyboardEvent( NULL, 1, true);
    CGEventRef keyEventUp = CGEventCreateKeyboardEvent(NULL, 1, false);

    CGEventKeyboardSetUnicodeString(keyEventDown, 1, unicodeString);
    CGEventKeyboardSetUnicodeString(keyEventUp, 1, unicodeString);

    CGEventTapPostEvent(proxy, keyEventDown);
    CGEventTapPostEvent(proxy, keyEventUp);

    CFRelease(keyEventDown);
    CFRelease(keyEventUp);

    ......

}

Pages doesn't hang if unicodeString contains only 1-byte unicode character.

I used gdb to debug Pages and noticed 2 infinite loops at that time, not sure if it's related to this issue.

0x91f7528c in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () which waited for event with mask 0xffffffff 0x91f7528c in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () which waited for event with mask 0x00000400


Does anybody know why this is happening ? Numbers and Keynote also have the same issue.

Thanks,
--
--huy
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to