down = CGEventCreateKeyboardEvent(NULL, 0 ,true);
up = CGEventCreateKeyboardEvent(NULL, 0 ,false);
CGEventKeyboardSetUnicodeString(down, 1, uChar);
CGEventKeyboardSetUnicodeString(up, 1, uChar);
CGEventPost(kCGHIDEventTap, down);
CGEventPost(kCGHIDEventTap, up);
Call the above procedures two times as one Emoji contains 2 UniChar.
Thanks for your reply.
In Big Sur, when I press the button in my software, it will show an emoji in a text editor. But in Monterey, it will show nothing.
My program does not crash in Monterey.
My software also has another button which will show "ab" in a text editor. It works in both Big Sur and Monterey.
Terry
down = CGEventCreateKeyboardEvent(NULL, 0 ,true);
up = CGEventCreateKeyboardEvent(NULL, 0 ,false);
CGEventKeyboardSetUnicodeString(down, 1, uChar);
CGEventKeyboardSetUnicodeString(up, 1, uChar);
CGEventPost(kCGHIDEventTap, down);
CGEventPost(kCGHIDEventTap, up);
Call the above procedures two times as one Emoji contains 2 UniChar.
Thanks for your reply.
In Big Sur, when I press the button in my software, it will show an emoji in a text editor. But in Monterey, it will show nothing.
My program does not crash in Monterey.
My software also has another button which will show "ab" in a text editor. It works in both Big Sur and Monterey.
Terry