Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要 Windows API 中的 SendInput 之类的东西。
看到这个方法,不知道有没有把unicode字符转换成虚拟键码的方法。
CGEventRef CGEventCreateKeyboardEvent ( CGEventSourceRef source, CGKeyCode virtualKey, bool keyDown );
CGEventRef e = CGEventCreateKeyboardEvent(NULL, NULL, true); CGEventKeyboardSetUnicodeString(e, unicodeStringLength, unicodeString); CGEventPost(kCGHIDEventTap, e);