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

Missing characters in TextInput field from fast sources (e.g. barcode scanners) #6801

Open
cstatz opened this issue Mar 29, 2020 · 1 comment

Comments

@cstatz
Copy link

cstatz commented Mar 29, 2020

Software Versions

  • Python: 3.7.3
  • OS: Raspbian Buster
  • Kivy: 2.0.0rc1, sdl2 backend
  • Kivy installation method: python3 setup.py develop --user

Describe the bug
When using fast keyboard-like devices (e.g. barcode scanners) characters are lost in the TextInput field (for longish barcodes). For example: 1234ABCDE12345678 could end up as 12DE12345 or 12DE!"§$%.
If the characters end up upper case the "virtual caps-lock" remains until the restart of the kivy app. I was able to observe this behavior with multiple apps using TextInput fields on raspbian with the sdl2 backend.

Expected behavior
I would expect the text is correctly captured independent of input device and speed. No characters or symbols are missing and there should be no "virtual caps-lock" when characters go missing.

To Reproduce
Use a barcode scanner (without any interkey delay - this "fixes" the problem, but is a nuisance for long barcodes in productive settings) with the Kivy RST-Editor example. Continuously scan long barcodes (>10 symbols) with letters (upper/lower case) and numbers.

Code and Logs and screenshots
There was no obvious error related to this issue in the logs.

Additional context
I was able to narrow down the problem to the kivy/core/window/_window_sdl2.pyx.
In _WindowSDL2Storage:

  • (line 536, class member poll) SDL_PollEvent is called with the gil released. The return value rv is hence in an undefined state after the with nogil block.
  • (line 530, class member wait_event) SDL_WaitEvent(NULL) is called with gil released and never waited.

Removing the nogil statements (around the aforementioned lines) fixes my barcode scanner problem (but may cause other problems).

@Julian-O
Copy link
Contributor

Julian-O commented Nov 3, 2023

Sounds awfully like #8061 could be related

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

No branches or pull requests

2 participants