Closed SpecialCharacter closed 3 years ago
PS: Tried it with '\U0001E000' and '\N{COMBINING GLAGOLITIC LETTER AZU}'. Always Type Error.
PPS: Updated to latest pynput version. Error persists.
Ḁ is u1E00 (i.e. a zero missing). I do not why he puts = (003D).
Sorry, it's Ḁ0, not Ḁ=. So he prints u1E00, 0 instead of u1E000. But when I try the long version U0001E000, it said Type Error. That should not happen, right?
I tested this with the following command: python -c 'import pynput, time; time.sleep(4); pynput.keyboard.Controller().type("\U0001E000")'
.
On my system, Linux/XWayland, this prints the expected character. On Windows, unicode is limited to 16 bits in many cases. pynput uses the KEYBDINPUT
struct to describe events, and the field designated for the unicode representation of the character is limited to 16 bits since the field wScan
is of type WORD
.
So, in short, what you are trying to do is not possible using the current implementation in pynput.
OK, so at least I am not crazy... Is there a temporary fix? Using a different entry method than KEYBDINPUT?
I encoded superscript Glagolitic A as kbc.type('\u1E000'), but it gave me Ḁ=. When I tried the proper character, it said Type Error.