Add keyheld module

Jan Blackquill requested to merge work/janblackquill/keyheld into master

📓 Summary

A special proxy GTK IM that loads other IM modules allows us to intercept key events for our desired behaviour (diacritics being offered when key is held) while allowing user-provided input methods to continue working.


Depends on

🧪 Testing

This is fairly complicated to test.


  1. Make sure you have another GTK IM module installed on your system before installing, for example fcitx and ibus have GTK IM modules

  2. Use the provided test inside plasma-input-module to install them to the same prefix as your GTK installation:

    cd plasma-input-module
    meson _build --prefix="$GTK_PREFIX" -Dpkg_config_path="$PKGCONFIG_PREFIX"
    cd _build
    ninja -j8
    sudo meson install

    On most distros, GTK is installed to /usr, so use /usr as your $GTK_PREFIX. For $PKGCONFIG_PREFIX use the directory from kdesrc-build plasma-integration patch, for example $PREFIX/kde/usr/lib/pkgconfig. But on different linux distributions it can be different, for example $PREFIX/kde/usr/lib64/pkgconfig or $PREFIX/kde/usr/lib/x86_64-linux-gnu/pkgconfig. This directory must contain plasma-key-data.pc file.

  3. Run the gtk-query-immodules command for your version of GTK and pipe the output to the IMModules cache. To figure out what the command is, type gtk-query-immodules-3 and press tab to complete. Once you figure out the command, you pipe its output to $GTK_PREFIX/gtk-3.0/3.0.0/immodules.cache:

    gtk-query-immodules-3.0 > $GTK_PREFIX/gtk-3.0/3.0.0/immodules.cache

    Sometimes gtk-query-immodules is not in PATH, so you need to call it explicitly, for example /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0.

  4. Set your GTK IM module to plasma-nothing and launch an app:

    env GTK_IM_MODULE=plasma-nothing gtk-app
Edited by Mikhail Zolotukhin

Merge request reports