Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom XKB layout #13700

Closed
1 task done
CaptaiNiveau opened this issue Jul 1, 2024 · 5 comments
Closed
1 task done

Custom XKB layout #13700

CaptaiNiveau opened this issue Jul 1, 2024 · 5 comments
Labels
accessibility Improvement related to color contrast, screen reader support, keyboard navigation, etc defect [core label] keymap / key binding Feedback for keyboard shortcuts, key mapping, etc linux

Comments

@CaptaiNiveau
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

To add to the list of fallacies:

Originally posted by @AlexDaniel in #5395 (comment)

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:

  • ':' ("Shift ;")
  • ')' ("Shift 0")

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
@CaptaiNiveau CaptaiNiveau added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Jul 1, 2024
@notpeter
Copy link
Member

notpeter commented Jul 2, 2024

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

@notpeter notpeter added linux keymap / key binding Feedback for keyboard shortcuts, key mapping, etc accessibility Improvement related to color contrast, screen reader support, keyboard navigation, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jul 2, 2024
@CaptaiNiveau
Copy link
Author

CaptaiNiveau commented Jul 2, 2024

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

@fsh
Copy link
Contributor

fsh commented Jul 8, 2024

I had a similar issue to you, and I fixed mine with #13931

Check to see if that works for you too if you're using X11. I don't have Wayland so didn't check/touch that. Incidentally, I also use Colemak and multiple groups/layers, tho I made it from scratch.

@CaptaiNiveau
Copy link
Author

CaptaiNiveau commented Jul 9, 2024

Nice, I compiled it from main (using the aur) and it seems to work properly, even from hyprland :D
I'll try some other stuff and close this issue when I'm certain that everything's fixed.

Btw, what do your layers look like? I got a Framework and want to use its QMK abilities to create even better layers - I'd love to take some inspiration ^^
If it's too off-topic, I wouldn't mind an e-mail either.

@fsh
Copy link
Contributor

fsh commented Jul 9, 2024

Cool if it works for you now, but if you are indeed on Wayland then I doubt it's because of my patch! My fix was exclusively for X11 client. Maybe some other patch got in there.


Re keymap:

My keymap isn't fancy, it's bespoke out of practicality. I used the Norwegian-ish layout as the base for non-A-Z when I switched to Colemak since I generally like it better than US and I needed æøå as "plain keys." But in my experience there's a "problem" with it—and other Nordic/European maps: tho the symbol/punctuation placement feels great & logical for writing text, it feels insane for programming, e.g. all the Shift <digit> or AltGr <digit> stuff.

So step by step I kept moving stuff off of the digit row since it's many painful miles away. My home row's third layer (AltGr or RAlt) is @{[(<>)]}~<Cómpósing Aćúté><Còmpòsing Gr̀àv̀è>. Other symbols—?!$ &%_=∈×^∧#≡*⋅… more čo̊m̧pōsin̈g chars—are on the other two rows. Now I only use the digit row for digits. The shifted version of the symbol layer tends to just have vaguely related symbols, e.g. ∈↔∉ [↔⟦ …↔⋯ ?↔¿ *↔∘. I also have another two layers (Menu or RCtrl or RWin) ( Shift) for more random stuff that is rarer (and admittedly harder to remember), mostly math-related stuff like ℝℤℵ∩∀∎∫∇‖±∂∏∑ & fun stuff like ♠♣♥♦¦“§”«¶»✓✗™ etc.

Of course, AltGr RWin[ Shift] gives yet two more layers... I originally set it up for Greek and stuff like that, but two modifiers side by side is beyond painful and everything without obvious mnemonics I don't recall anyway. At some point I want to clean it up and maybe try latched/locked modifiers for other alphabets (Greek or math-variants like 𝖆𝖇𝖈𝕒𝕓𝕔 etc.). More and more keyboards put the braindead Fn-key (gods I hate it) where I want my second modifier to be, so it'd be cool if I could compress to only one modifier ( shift) for symbol input. E.g. AltGr g might be a Greek latch and AltGr G a Greek lock, etc. Stuff like that would be cool, but it's been many years since I touched Xkb configs. Plus, I use these symbols like…maybe 6 times a year… So it's one of those "spend a week in a keymap rabbit hole to maybe save 1 minute of extra work per year" kind of things…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Improvement related to color contrast, screen reader support, keyboard navigation, etc defect [core label] keymap / key binding Feedback for keyboard shortcuts, key mapping, etc linux
Projects
None yet
Development

No branches or pull requests

3 participants