PINE64
[Phosh] Remapping keys of an external keyboard - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Accessories (https://forum.pine64.org/forumdisplay.php?fid=123)
+--- Thread: [Phosh] Remapping keys of an external keyboard (/showthread.php?tid=14560)



[Phosh] Remapping keys of an external keyboard - Zombie Feynman - 07-31-2021

I recently bought a no-brand foldable Bluetooth keyboard (picture) for use with my PinePhone (running Mobian). The basic keys work fine, and I got deadkeys/lv3/compose to work by firing up dconf-editor and editing /org/gnome/desktop/input-sources/sources and /org/gnome/desktop/input-sources/xkb-options.

Unfortunately, though, some of the special keys don't work as expected. Fn+[top row keys] always produces the keysym of the "upper" blue function instead of the "lower" one, e.g. Fn+` produces XF86HomePage instead of Escape, and similar for the other top-row keys. wev reveals that Fn+` produces keycode 180, and indeed, in the output of xkbcomp, I see:
Code:
    key <I180> {         [    XF86HomePage ]
I changed XF86HomePage to Escape and tried to reinsert the keymap with xkbcomp, but some searching reveals that this is not possible on Wayland. So I instead added
Code:
    key <I180> { [    Escape, XF86HomePage ] };
to the intl section in /usr/share/X11/xkb/symbols/us and rebooted. But this did not remap the key; rather, the xkbcomp output now shows
Code:
    key <I180> {         [    XF86HomePage,    XF86HomePage ] };

I guess something is overriding the change, but I don't know what exactly, or even how to find out. I'm unfamiliar with the whole Wayland/GNOME/Phosh stack (I've never had a need for anything other than X11), so I feel like I'm really out of my depth here. Does anyone know how to proceed with this?