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

android hardware back button does not work in kivy #1903

Closed
Fak3 opened this issue Jul 1, 2019 · 1 comment
Closed

android hardware back button does not work in kivy #1903

Fak3 opened this issue Jul 1, 2019 · 1 comment

Comments

@Fak3
Copy link
Contributor

Fak3 commented Jul 1, 2019

kivy version: git master (and latest stable)
p4a version: develop branch (and latest stable)
backend: sdl2

i have added keyboard hook for hardware button as suggested in p4a documentation:

class YourApp(App):

   def build(self):
      Window.bind(on_keyboard=self.key_input)
      return Widget() # your root widget here as normal

   def key_input(self, window, key, scancode, codepoint, modifier):
      if key == 27:
         print('back pressed')
      else:           # the key now does nothing
         return False

The hook does not receive any hardware backbutton input until i click any kivy TextInput. After i click any TextInput, android keyboard appears, then i can close it, and from now on hardware back button works just fine everywhere in the app (key 27 input is received). Another quirk: it stops working again if app is paused and resumed.
It happens only on some android devices: namely ZTE nubia z11 mini (android 5.1) and samsung galaxy S5. On some other devices it works fine.

@Fak3
Copy link
Contributor Author

Fak3 commented Jul 3, 2019

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