On-screen keyboard fails to open automatically in KDE on a touch device

Problem

On touch devices (tablets, 2-in-1 laptops, touchscreens, etc), a virtual keyboard should automatically pop up in KDE whenever you touch a text input field. However, this is currently not the case for Maliit, the default virtual keyboard for the KDE Plasma Spin (except for initial login via sddm), even when the virtual keyboard is enabled. Instead, the keyboard must be manually toggled on via the panel and toggled off via the virtual keyboard setting. This issue persists even with the plasma-mobile package if it’s installed alongside the KDE Plasma Spin (which requires users to use a physical keyboard to log in to their mobile device).

Cause

It seems that the imsettings-plasma package in the “Input Methods” group is causing this issue. It installs a shell script at /etc/xdg/plasma-workspace/env/xinput.sh which contains two functions that update the GTK_IM_MODULE and QT_IM_MODULE environment variables, but this breaks the expected auto-popup functionality.

Related Issues

KDE SIG issue tracker: https://pagure.io/fedora-kde/SIG/issue/371
Bugzilla tracker: 2226646 – Maliit On Screen Keyboard Fails to Open Automatically On KDE Plasma Workspaces

Workarounds

In the terminal, run:

mkdir -p ~/.config/plasma-workspace/env/

Next, create a file at ~/.config/plasma-workspace/env/immodule_temp_fix.sh. Populate it with the following:

#!/bin/bash
# A temporary workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2226646
unset GTK_IM_MODULE
unset QT_IM_MODULE

Reboot for settings to take effect. After logging in, you should see an “Input Method” icon in the system tray. Make sure the virtual keyboard is activated (click on it to toggle the state). Now, whenever you use the touchscreen to touch a text input field, the virtual keyboard should automatically pop up.

Video guide

There’s a video guide for the workaround above:

Reverting the workaround

Follow the bug report for guidance about when the bug has been fixed. Delete ~/.config/plasma-workspace/env/immodule_temp_fix.sh workaround file when an official fix has been released.


You can discuss this issue here.

1 Like

6 posts were merged into an existing topic: Talk: On-screen keyboard fails to open automatically in KDE on a touch device