Backspace key does not trigger any event in a virtual keyboard on an embedded device

65 views Asked by At

When I run my Qt application on a desktop, the virtual keyboard works fine, but when I run it on an embedded Linux device, the backspace key doesn't work at all.

I have installed an event filter to print all the events, and I see that, when running the app on a desktop (Windows or Linux), KeyPress and KeyRelease events are triggered for all keys, and all work fine. But, when executing on the Linux embedded device, the event triggered is QEvent::InputMethod instead, and the backspace key does not even trigger any event, and does not work at all.

If I plug in a real keyboard to the embedded device, the backspace works as expected and the events received are KeyPress and KeyRelease.

I guess that the problem is in the virtual keyword of the embedded device (it looks much simpler and seems to not be generating the right events), but I'm using the same version (1.0) in both environments.

This is the simplified QML; as you can see, I'm using QtQuick.VirtualKeyboard 1.0:

import QtQuick 2.15
import QtQuick.VirtualKeyboard 1.0
import QtQuick.Controls 2.15
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.3

Rectangle {
    id: root
    width: 640
    height: 480
    color: "red"

   TextField {
        id: test
        Layout.fillWidth: true
        horizontalAlignment: TextInput.AlignHCenter
        color: "white"
        font.pointSize: 20
        background: Rectangle {
            color: "red"
            border.color: "white"
        }
        onTextChanged: {
            classMyDialog.setText(text);
        }
    }

    InputPanel {
        id: inputPanel
        y: Qt.inputMethod.visible ? parent.height - inputPanel.height : parent.height
        anchors.left: parent.left
        anchors.right: parent.right
    }
}

I would like to update the virtual keyboard in the embedded device, but I'm not sure how to do it, I'm using Qt5 (5.15), with Yocto 4.0 (kirkstone), and Linux 6.1.45.

I found a qtvirtualkeyboard_git.bb recipe, and I guess it is just a matter of updating the source revision. It has:

SRCREV = "4191fd9098ae25ffd5917370427460842e73f0cb"

But I haven't found what hash to use, I don't find that commit in qtbase repo.

0

There are 0 answers