Android soft keyboard action button
-
There is Dialog (from Qt.Quick Dialogs) with few SpinBoxes, when user edit an SpinBox value then press 'Done' button (on Android software keyboard) whole Dialog closes.
How can i replace 'Done' with 'Next' keyboard action button on or change that behavior? -
OK! I solved it as follow in Qt 5.12:
import QtQuick 2.12 import QtQuick.Controls 2.12 Column { TextField { id: field1 KeyNavigation.tab: field2 //<--- what is next element? activeFocusOnTab: true //<--- I want use tab key for desktop version EnterKey.type: Qt.EnterKeyNext //<--- change 'done' label to 'next' Keys.onReturnPressed: KeyNavigation.tab.forceActiveFocus(); //<--- focus next element same as tab key does } TextField { id: field2 KeyNavigation.tab: field3 activeFocusOnTab: true EnterKey.type: Qt.EnterKeyNext Keys.onReturnPressed: KeyNavigation.tab.forceActiveFocus(); } TextField { id: field3 KeyNavigation.tab: field1 activeFocusOnTab: true EnterKey.type: Qt.EnterKeySend //<--- change label of return key of the soft keyboard as 'send' Keys.onReturnPressed: sendData(); //<--- finally send data if user pressed done button (return button) } }
NOTE: Action button of the Android soft keyboard is same as return button which you can control it in XML layout file with 'imeOptions' attribute.
-
Thanks so much for posting this result!
This worked for me in QT 5.14.2@seyed said in Android soft keyboard action button:
NOTE: Action button of the Android soft keyboard is same as return button which you can control it in XML layout file with 'imeOptions' attribute.
Can you elaborate on this?
I'm working on Android and am not seeing the 'Done' button changing as expected, but I do see in the QT Docs:
Note: Not all of these values are supported on all platforms. For unsupported values the default key is used instead.