moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.77k stars 245 forks source link

How to get Quartz.CGEventKeyboardGetUnicodeString to tell me which base character I typed last? #493

Open SpecialCharacter opened 2 years ago

SpecialCharacter commented 2 years ago

Description How to get Quartz.CGEventKeyboardGetUnicodeString to tell me which base character I typed last?

Platform and pynput version MacOS Catalina 10.15.7 pynput version unknown

To Reproduce I type a base character and then a combining character. I know only the last typed character (the combining character). I want to retrieve the base character I typed before, by means of Quartz.CGEventKeyboardGetUnicodeString or another electronic method. Is that possible and how exactly? I want this base character stripped of its combining character (in case it is still attached to it) and inserted (by means of chars or another variable) into the output string.