SUMMARY You can't force disable the virtual keyboard in KDE Plasma. This is troublesome if your PC only has a bluetooth keyboard connected. STEPS TO REPRODUCE If you have e.g. an HTPC with only a bluetooth keyboard connected, and this keyboard has power management enabled (so it disconnects after e.g. 10 minutes of inactivity), you will not be able to avoid getting a message saying "On-screen virtual keyboard enabled" when the power to the keyboard turns off. And when you activate the keyboard again you'll get the message "On-screen virtual keyboard disabled". This is not ideal, especially since there's no way of disabling this behaviour. OBSERVED RESULT Everytime the bluetooth keyboard turns off or on, you'll get a message saying so, often during watching a movie. EXPECTED RESULT You can't always deduce out from hw configuration if it makes sense to have a on screen keyboard appear or not, so we really should have a way to force disable it to ever appear. SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.20.4 KDE Frameworks Version: 5.77 Qt Version: 5.15.2 ADDITIONAL INFORMATION This was tested in a Wayland environment.
Here's a quick patch to disable the message if anyone needs it: diff --git a/virtualkeyboard.cpp b/virtualkeyboard.cpp index 85c7da2..9e682bc 100644 --- a/virtualkeyboard.cpp +++ b/virtualkeyboard.cpp @@ -233,17 +233,6 @@ void VirtualKeyboard::setEnabled(bool enabled) return; } m_enabled = enabled; - emit enabledChanged(m_enabled); - - // send OSD message - QDBusMessage msg = QDBusMessage::createMethodCall( - QStringLiteral("org.kde.plasmashell"), - QStringLiteral("/org/kde/osdService"), - QStringLiteral("org.kde.osdService"), - QStringLiteral("virtualKeyboardEnabledChanged") - ); - msg.setArguments({enabled}); - QDBusConnection::sessionBus().asyncCall(msg); }
Makes sense, though it seems like this maybe is a bug in how KWin handles Bluetooth keyboards that have disconnected, or in how it shows a notification when the virtual keyboard is enabled.
Git commit 92fb680b04463593c78fcfa4a71e9682805281b4 by Aleix Pol Gonzalez, on behalf of Aleix Pol. Committed on 26/04/2021 at 12:40. Pushed by apol into branch 'master'. Provide a kcm module to choose a virtual keyboard M +1 -0 src/kcmkwin/CMakeLists.txt A +28 -0 src/kcmkwin/kwinvirtualkeyboard/CMakeLists.txt A +2 -0 src/kcmkwin/kwinvirtualkeyboard/Messages.sh A +18 -0 src/kcmkwin/kwinvirtualkeyboard/kcm_virtualkeyboard.desktop A +102 -0 src/kcmkwin/kwinvirtualkeyboard/kcmvirtualkeyboard.cpp [License: GPL(v2.0+)] A +55 -0 src/kcmkwin/kwinvirtualkeyboard/kcmvirtualkeyboard.h [License: GPL(v2.0+)] A +39 -0 src/kcmkwin/kwinvirtualkeyboard/package/contents/ui/main.qml [License: GPL(3+eV) GPL(v3.0) GPL(v2.0)] A +13 -0 src/kcmkwin/kwinvirtualkeyboard/package/metadata.desktop A +10 -0 src/kcmkwin/kwinvirtualkeyboard/virtualkeyboardsettings.kcfg A +6 -0 src/kcmkwin/kwinvirtualkeyboard/virtualkeyboardsettings.kcfgc https://invent.kde.org/plasma/kwin/commit/92fb680b04463593c78fcfa4a71e9682805281b4