zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
39.49k stars 2.06k forks source link

Custom XKB layout #13700

Open CaptaiNiveau opened 4 days ago

CaptaiNiveau commented 4 days ago

Check for existing issues

Describe the bug / provide steps to reproduce it

To add to the list of fallacies:

Originally posted by @AlexDaniel in https://github.com/zed-industries/zed/issues/5395#issuecomment-1908666401

This (locked) issue still exists and I'm running into it, using Colemak + Extend from Dreymar. Specifically, the Extend layer causes some key combinations to not be picked up by zed. Examples:

The issue disappears for ':' (Qwerty p/P, Colemak ;/:) if I comment out the following lines from the Extend config file located at xkb-data_xmod/xkb/symbols/extend in the repo:

key <AD10> { symbols[Group1]=[Any       , Any       , Any       , Any       ,   // P
        Delete                      , Delete                        ,   // Del
        KP_Add                      , KP_Add                        ] , // KP_+
     actions[Group1]=[NoAction(), NoAction(), NoAction(), NoAction(),
        Redirect(key=<DELE>,clearmods=LevelFive), Redirect(key=<DELE>,clearmods=LevelFive),     // <DELE>
        NoAction()                  , NoAction()                    ] ,
     repeat=yes     };  // QWE P, Cmk ; :

wev produces the correct results and without the extend layer zed reads these keys correctly. Changing to default QWERTY instead of Colemak doesn't change this issue, as long as Extend is still active.

Environment

Zed: v0.141.3 (Zed) OS: Linux Wayland arch unknown Memory: 58.7 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Zed.log


notpeter commented 3 days ago

@CaptaiNiveau Forgive me, I'm new to this -- I don't have all the original context, I've never tried to used Colemak and it's been two two decades since I used a custom XKB on Linux. But I want to understand the issue you're having.

Could you please edit your description so I might better understand the scope of your issue and have a good chance of being able to reproduce it? (steps to reproduce, etc). Truly ExpainItLikeIm5 and I will do my best.

We want to try and support Linux users and a diversity of configurations where possible, but I want to be upfront, I can make no promises. In the future please imagine the real human being reading your words (me!). Even if you feel wronged, opening a new issue with a 1000 word block quote is coming in pretty hot. It's extremely unlikely to generate your desired response, but let's try and de-escalate a bit and take another crack at it.

CaptaiNiveau commented 3 days ago

Oh, no worries, this is in good faith :)

The way you configure your keyboard layout heavily depends on your Desktop Environment (DE), even if all of them actually use XKB under the hood (both X11 and all Wayland compositors I know of use it). I'm running Hyprland and the XKB config is just a few lines in its input config. If you check Dreymars repo I linked above, there's more detailed information on how to use Colemak/Extend on the most popular DEs (KDE Plasma, Gnome).

For this issue, you don't have to switch QWERTY for Colemak, just activate Extend. If you tell me which DE you're on, I can tell you how to, in case you get stuck. I spent a while optimizing my keyboard and trying to figure out how to actually make these layouts work in Linux (issues with key repeat, XWayland etc.), so I totally understand where you're coming from ^^

If you're running in an X11 session, it's a lot easier to apply this layout using the install-dreymar-xmod.sh command in the repo, while Wayland sessions commonly have their own config file for this.

I'm happy to help you with whatever you're getting stuck with. It's probably easier if you tell me which DE (think KDE Plasma/Gnome/XFCE) you're using and if you're in a Wayland or X11 session (echo $XDG_SESSION_TYPE if you're unsure). This way, I can give you way more specific advice on how to replicate my issue.

Btw, I'm totally happy that you're supporting Linux at all, no need to de-escalate. Thanks for open-sourcing this awesome project ^^