Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • postmarketos-ondev postmarketos-ondev
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • postmarketOSpostmarketOS
  • postmarketos-ondevpostmarketos-ondev
  • Issues
  • #18
Closed
Open
Issue created Jun 29, 2020 by Oliver Smith@ollieparanoidOwner

Qt Virtual Keyboard fails with "input method is not set"

Roughly 50% of the times when the virtual keyboard is started, it is broken. Touching the buttons prints "input method is not set" on the terminal, instead of inserting the characters.

Upstream bug report: https://bugreports.qt.io/browse/QTBUG-80281

Here is a workaround that appeared to be working: https://forum.qt.io/post/594648 -- but after more testing, it appears that the bug just happens randomly, with the workaround applied and without it ☹.

I've also tried different workarounds, like calling .reset() and doing the same thing as in the workaround in an interval (twice per second). It did not help.

I won't be able to fix this until releasing postmarketos-ondev 0.2.0, which I'll do later today. However, I'll try to fix this soon by digging into the qtvirtualkeyboard souce, adding debug prints and figuring out why inputMethod is not set. From qvirtualkeyboardinputengine.cpp:

    bool virtualKeyClick(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers, bool isAutoRepeat)
    {
        Q_Q(QVirtualKeyboardInputEngine);
        bool accept = false;
        if (inputMethod) {
            accept = inputMethod->keyEvent(key, text, modifiers);
            if (!accept) {
                accept = fallbackInputMethod->keyEvent(key, text, modifiers);
            }
            emit q->virtualKeyClicked(key, text, modifiers, isAutoRepeat);
        } else if (QT_VIRTUALKEYBOARD_FORCE_EVENTS_WITHOUT_FOCUS) {
            accept = fallbackInputMethod->keyEvent(key, text, modifiers);
            emit q->virtualKeyClicked(key, text, modifiers, isAutoRepeat);
        } else {
            qWarning() << "input method is not set";
        }
        return accept;
    }

CC: @bshah

Edited Jun 29, 2020 by Oliver Smith
Assignee
Assign to
Time tracking