How to remap keys (xmodmap freezes my system)

I use X11. I would like to swap p and ; keys. I did it by using xmodmap, following this guide https://linuxconfig.org/reprogram-keyboard-keys-with-xmodmap. Unfortunately this leads to system freezing upon every login, bluetooth connection and some other situations. This seems to be old bug https://bugs.kde.org/show_bug.cgi?id=306352. Remapping keys with xkb looks complicated. Is there any other way to swap keys?

Hello and welcome to the openSUSE forums.

If any desktop environment is involved, then please always tell us which one.

KDE Plasma ver. 5.27.8

I just found and used keyd https://github.com/rvaiya/keyd. It did the job and was easy to use.

Nice you found a solution (finding it yourself is satisfying) and thanks for reporting back for the benefit of others.

Did you install the “keyd” package from the openSUSE repositories?

 > LANG=C zypper info keyd
Loading repository data...
Reading installed packages...


Information for package keyd:
-----------------------------
Repository     : Main Repository
Name           : keyd
Version        : 2.4.2-bp155.1.6
Arch           : x86_64
Vendor         : openSUSE
Installed Size : 1.6 MiB
Installed      : No
Status         : not installed
Source package : keyd-2.4.2-bp155.1.6.src
Upstream URL   : https://github.com/rvaiya/keyd
Summary        : A key remapping daemon for linux
Description    : 
    Linux lacks a good key remapping solution.
    In order to achieve satisfactory results a medley of tools need to be employed
    (e.g xcape, xmodmap) with the end result often being tethered to a specified
    environment (X11).
    keyd attempts to solve this problem by providing a flexible system wide daemon
    which remaps keys using kernel level input primitives (evdev, uinput).

 >

Yes I did. I wanted app from official repository.