pynput icon indicating copy to clipboard operation
pynput copied to clipboard

Incorrect pynput.keyboard.Controller().type("سلام") output

Open i3130002 opened this issue 3 years ago • 2 comments

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('سلام')

i3130002 avatar May 03 '21 19:05 i3130002

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.

moses-palmer avatar Oct 11 '21 20:10 moses-palmer

It does the same thing wring سللم as an output. I should add that ل and ا are different. (ل + ل = لل and ل + ا = لا ) Think it has wrong mapping for ا.

i3130002 avatar Dec 16 '21 09:12 i3130002