Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type method crashes on cyrillic characters #582

Open
mox512 opened this issue Jan 2, 2024 · 1 comment
Open

Type method crashes on cyrillic characters #582

mox512 opened this issue Jan 2, 2024 · 1 comment

Comments

@mox512
Copy link

mox512 commented Jan 2, 2024

Type method crashes on cyrillic characters.
Not all of them, thought, it manages to type "Привет как дела?"
But consistently crushes on letters such as "Ж" "M" in both upper case and lowercase.

Ubuntu 23.04
X.Org X Server 1.21.1.7
pynput 1.7.6
Layouts obviously in the system.

To reproduce run : python -c "import pynput; pynput.keyboard.Controller().type('Мороженка')"
`

denis@yoga:~$ python -c "import pynput; pynput.keyboard.Controller().type('Мороженка')"
Traceback (most recent call last):
  File "/home/denis/Documents/CVBuild/venv/lib/python3.11/site-packages/pynput/keyboard/_base.py", line 492, in type
    self.release(key)
  File "/home/denis/Documents/CVBuild/venv/lib/python3.11/site-packages/pynput/keyboard/_base.py", line 427, in release
    self._handle(resolved, False)
  File "/home/denis/Documents/CVBuild/venv/lib/python3.11/site-packages/pynput/keyboard/_xorg.py", line 236, in _handle
    raise self.InvalidKeyException(key)
pynput.keyboard._base.Controller.InvalidKeyException: 'М'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/denis/Documents/CVBuild/venv/lib/python3.11/site-packages/pynput/keyboard/_base.py", line 495, in type
    raise self.InvalidCharacterException(i, character)
pynput.keyboard._base.Controller.InvalidCharacterException: (0, 'М')

`

@mox512
Copy link
Author

mox512 commented Jan 2, 2024

Seems to be related to #193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant