39aldo39/klfc

XKB: arrow keys from Extend layer behave differently than arrow keys in Base layer

lmlask opened this issue · 4 comments

XKB is so weird.

I've generated an Extend layer with KLFC (a while back). For some reason it never works with sufficient stability in KDE or XFCE, but works perfectly when installed to system in GNOME (in Ubuntu, Manjaro GNOME and Pop!_OS, always worked).

The problem at hand: "Proper" (base layer, normal) arrow keys will work for general navigation (e.g. Nautilus, highlighting stuff in GUI), but arrow keys from the Extend layer will not.

xev returns different key codes for each.

  • The proper Left will return keycode 113;
  • The Left from the Extend layer will return keycode 44, with a subsequent XKeysymToKeycode returns keycode:113 line.

I wonder if that's where the problem lies.

Any thoughts?

Yes, XKB is weird. In my XKB Extend layer I've used Redirect actions instead of simple remaps, as those seem necessary in many instances. See the Big Bag for XKB repo, in the symbols/extend file.

https://github.com/DreymaR/BigBagKbdTrixXKB/blob/master/xkb-data_xmod/xkb/symbols/extend

The normal mappings are correct, but, as you see, not all applications adhere them. Like DreymaR says, redirect actions work better and can be enabled by using the option --xkb-redirect-all. However, this only works in X.org and Wayland uses a different implementation which doesn't support it...

I'm using X right now - I'll try to redirect all and see if that helps.
Thanks, fellows.

Edit: Yup, fixed. Thanks again!

Wayland supports redirects though? At least, people use my BigBag for XKB files on Wayland, with Extend, and it works from what I hear. In particular, Extend+C for instance produces a redirect with the Ctrl modifier plus C to produce Ctrl+C for Copy.