kivy / python-for-android

Turn your Python application into an Android APK
https://python-for-android.readthedocs.io
MIT License
8.33k stars 1.84k forks source link

Bug in the keyboard event listener #2423

Closed Neizvestnyj closed 1 year ago

Neizvestnyj commented 3 years ago

When I click on the input field, the event handler that is declared in the init method stops working (events like 'back') , but if I switching focus away from the whole app, then back again, the handler starts working until I click on the text field again.

All this I tested with: api: 27, 28, 29, 30 ndk: 19b, 19c, 20b, 21e p4a branch: develop, master, release-2019.06.06, release-2020.06.02

p4a.bootstrap = sdl2 android.arch = armeabi-v7a, arm64-v8a

Code: https://pastebin.com/RJH6abdG

https://user-images.githubusercontent.com/40869738/108220548-e562b480-7147-11eb-97c9-211828d2bffd.mp4

RobertFlatt commented 3 years ago

Well you didn't get an answer there https://github.com/kivy/kivy/issues/7374 So I suppose it doesn't hurt to try here ;)

However I think nobody understands what is going on as shown by:

https://github.com/kivy/python-for-android/issues/1903 https://github.com/kivy/kivy/issues/6686 https://github.com/spesmilo/electrum/issues/6276 https://github.com/kivy/kivy/issues/7375

Neizvestnyj commented 3 years ago

@RobertFlatt Yes, most likely the problem is with p4a, or rather with sdl, and the bug is old, and not related to Google, they are doing well

RobertFlatt commented 3 years ago

Months later, I think this may be due to the event listener not returning a boolean, https://github.com/kivy/python-for-android/blob/develop/doc/source/apis.rst#handling-the-back-button

Neizvestnyj commented 3 years ago

Months later, I think this may be due to the event listener not returning a boolean, https://github.com/kivy/python-for-android/blob/develop/doc/source/apis.rst#handling-the-back-button

For my example, this did not solve the problem. But now suggestions works (It's still broken, but at least something). requirements = kivy==master p4a.branch = develop

Neizvestnyj commented 1 year ago

Hi everyone, has this bug been fixed yet?

Neizvestnyj commented 1 year ago

Fixed in kivy==master (2.2.0dev0)