Skip to content

Fix Qt bootstrap handling of non-back key events#3343

Open
lazycat11 wants to merge 1 commit into
kivy:developfrom
lazycat11:fix-qt-non-back-key-events
Open

Fix Qt bootstrap handling of non-back key events#3343
lazycat11 wants to merge 1 commit into
kivy:developfrom
lazycat11:fix-qt-non-back-key-events

Conversation

@lazycat11

Copy link
Copy Markdown
Contributor

Summary

  • handle only Android Back key events in the Qt bootstrap double-tap-to-exit logic
  • pass all other key events through to Qt via super.onKeyDown
  • checked the other bootstraps: webview/service_only already guard KEYCODE_BACK, and the remaining bootstraps do not use this double-back exit logic

Testing

  • git diff --check
  • fork GitHub Actions workflow Unit tests & build apps run 26929233140 completed successfully, including Flake8, Java Spotless, pytest matrix, recipe tests, emulator run, and Qt app build

public boolean onKeyDown(int keyCode, KeyEvent event) {
// If it wasn't the Back key or there's no web page history, bubble up to the default
// system behavior (probably exit the activity)
if (keyCode != KeyEvent.KEYCODE_BACK) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems not to be the best approach as it's colliding with the rest of its code and its purpose. Instead of doing this you should try another approach from the app itself on how it handles the back key.

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

Successfully merging this pull request may close these issues.

2 participants