39aldo39 / klfc

Keyboard Layout Files Creator
GNU General Public License v3.0
222 stars 12 forks source link

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

Closed lmlask closed 1 year ago

lmlask commented 1 year ago

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.

I wonder if that's where the problem lies.

Any thoughts?

DreymaR commented 1 year ago

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

39aldo39 commented 1 year ago

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...

lmlask commented 1 year ago

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

Edit: Yup, fixed. Thanks again!

DreymaR commented 1 year ago

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.