Devin Lin 78f55374e1 Add support for non-full width operation, and improve floating mode
This extends https://invent.kde.org/plasma/plasma-keyboard/-/merge_requests/31

We still retain two modes, "toplevel" and "floating" modes.
- "Toplevel" - KWin handles keyboard placement always being at the
  bottom of the screen;
- "Floating" - Keyboard placement can be customized by the user, KWin
  does not reserve space

I added a new config option`panelScreenWidthPct` to allow
customization of how wide the panel is as a percentage of the screen
width. By default we have 1.0 (100%), but some users (like @mwolff) may
want it to be 50%. In the future, we can allow users to resize it by
dragging on the edges.

For the floating mode, I wrapped the keyboard panel with a "window"
widget. I added a drag handle at the top to allow users to move the
panel around.

I made necessary improvements to the window mask to support having non
full-width panels.
2025-08-04 20:58:36 -04:00
2024-06-14 19:47:13 +02:00
2025-08-01 01:49:11 +00:00
2025-02-06 08:03:06 +01:00
2025-02-12 07:29:52 +01:00

Plasma Keyboard

The plasma-keyboard is a virtual keyboard based on Qt Virtual Keyboard designed to integrate in Plasma.

Build and install

mkdir build && cd build
cmake ..
make && make install

Usage with kwin

To actually leverage plasma-keyboard with kwin, you need to start kwin with the --inputmethod argument set to plasma-keyboard, e.g.:

kwin_wayland --inputmethod plasma-keyboard

Troubleshooting

If the Virtual Keyboard does not show up add KWIN_IM_SHOW_ALWAYS=1 to kwin's environment variables.

Top Level vs. Floating Mode

By default, the Virtual Keyboard will use a top level window that is sized to occupy the full screen width. The height is automatically deduced based on the inherent keyboard size ratio. The keyboard will be shown at the bottom of the screen.

In the top level window mode, all other windows will be automatically resized to fit into the remaining space at the top of the screen. While this mode is perfect for portrait screens, the keyboard may be too large for widescreens in landscape orientation.

If you instead want to use a floating virtual keyboard, you can add QT_WAYLAND_INPUT_PANEL_TOPLEVEL=0 to kwin's environment variables. This will enable the floating mode, where the keyboard overlaps other windows. The width of the floating window is also reduced to half the screen width. The floating keyboard window will be shown horizontally centered at the bottom of the screen.

Languages
QML 63.9%
C++ 33.9%
CMake 2%
Shell 0.2%