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

use Qt virtual keyboard for Android QML #8275

Merged
merged 3 commits into from
Mar 23, 2023
Merged

use Qt virtual keyboard for Android QML #8275

merged 3 commits into from
Mar 23, 2023

Conversation

accumulator
Copy link
Member

@accumulator accumulator commented Mar 22, 2023

EDIT(ghost43): see #8256

@@ -111,5 +116,8 @@ def stop(self):
self.app.quit()

def get_default_language(self):
# On Android this does not return the system locale
# TODO: retrieve through Android API
Copy link
Member

Choose a reason for hiding this comment

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

kivy has some code for Android:

def get_default_language() -> str:

Copy link
Member Author

@accumulator accumulator Mar 22, 2023

Choose a reason for hiding this comment

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

Thanks. I was aware we can do it through jnius, but importing jnius is a bit slow, so I wanted to check if the PyQt QtAndroidExtras module could be used, and if it's faster :)

Edit: seems that the bindings for QtAndroidExtras are very minimal, currently not worth the effort.

@accumulator
Copy link
Member Author

As the virtual keyboard will probably be a source of contention, as its behaviour and style is a personal preference, we could opt to make its use a configuration setting. Just like the UI language, we would need to show a message that the app needs to be restarted for the setting to take effect.

thoughts? @ecdsa @SomberNight

@ecdsa
Copy link
Member

ecdsa commented Mar 23, 2023

no, it should not be optional. we really do not want users to type their seed in a custom keyboard app.
why do you think it will be source of contention?

@SomberNight
Copy link
Member

SomberNight commented Mar 23, 2023

It's quite non-standard for an app to force-replace the system keyboard with its own. I don't recall seeing it before. So some users are bound to complain.
(EDIT: for example, imagine someone having customised their keyboard app to use a dvorak layout and make Doom sounds on every keypress. They are sure to complain to have to make do without what they are used to.)

However, using it for seed entry is a matter of security. I concur that we should not let the user enter their seed using the system keyboard (as it might be any custom app).

@SomberNight
Copy link
Member

This broke running on desktop for me.

 ./run_electrum --testnet -g qml
  1.01 | E | gui.qml.qeapp.QEAppController | unable to bind intent: ModuleNotFoundError("No module named 'android'")
  1.10 | W | gui.qml.qeapp | QQmlApplicationEngine failed to load component
  1.10 | W | gui.qml.qeapp | file:///home/user/wspace/electrum/electrum/gui/qml/components/main.qml:273:5: Type InputPanel unavailable
  1.10 | W | gui.qml.qeapp | qrc:/QtQuick/VirtualKeyboard/content/InputPanel.qml:127:5: Type Keyboard unavailable
  1.10 | W | gui.qml.qeapp | qrc:/QtQuick/VirtualKeyboard/content/components/Keyboard.qml:38:1: module "QtQuick.VirtualKeyboard.Plugins" is not installed

Do I need to install something? qml-module-qtquick-virtualkeyboard from apt (ubuntu) is apparently already installed.

@ecdsa ecdsa deleted the qt_vkbd branch March 23, 2023 14:41
@SomberNight
Copy link
Member

Apparently the qtvirtualkeyboard-plugin package is needed.

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.

None yet

3 participants