Configurable Virtual Keyboard behavior

This merge request adds new options to the Virtual Keyboard KCM to control when the Virtual Keyboard automatically appears on screen after interacting with an input field:

  • When using mouse, touch or pen (exposes the functionality of KWIN_IM_SHOW_ALWAYS to the virtual keyboard KCM, the environment variable has been removed)
  • Only when using touch or pen (the current behavior)
  • Only when in Touch Mode (the conditions from the previous option, but only if the device is a convertible 2-in-1 and it is flipped back, or Touch Mode is enabled in the General Behavior KCM)

The second option is automatically hidden if the device doesn't support Touch/Tablet Mode, since it is not relevant and potentially confusing.

I have added this since when using KDE on a 2-in-1 device, there's no need to have the virtual keyboard show up when a physical keyboard is already in front of you, so it only appears when the physical keyboard is flipped back, matching the behavior with Windows and GNOME, among other environments

This is my first contribution to KDE, so feel free to point out any concerns or bugs.

Screenshots:

Device compatible with Touch/Tablet Mode Device not compatible with Touch/Tablet Mode
Screenshot_20260111_211653 Screenshot_20260111_211623
Edited by Luca Tramonti

Merge request reports

Loading