pynput
pynput copied to clipboard
Incorrect pynput.keyboard.Controller().type("سلام") output
Description
Using pynput.keyboard.Controller().type('سلام') should output سلام
where the cursor is. Whereas it would type سللم
Platform and pynput version I'm using python 3.8.5 64 on Ubuntu 20.04.2 LTS none root. I also use English(US) and Persian keyboard layout as secondary.
To Reproduce
import pynput, time
time.sleep(5)
pynput.keyboard.Controller().type('سلام')
Thank you for your report, and sorry for this late reply.
I am afraid that I cannot reproduce; for me, it consistently prints salaam. Have you tried other variations to rule out strange RTL issues in your editor? Dos the following script produce the same error?
import pynput, time
time.sleep(5)
cs = [
'س',
'لا',
'م',
]
pynput.keyboard.Controller().type(''.join(cs))
I run the scripts under XWayland, so that may be another cause for the discrepancy.
It does the same thing wring سللم
as an output.
I should add that ل and ا are different. (ل + ل = لل
and ل + ا = لا
) Think it has wrong mapping for ا
.