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

Shifted symbols don't work in Rust applications #820

Open
bermell opened this issue Feb 21, 2024 · 3 comments
Open

Shifted symbols don't work in Rust applications #820

bermell opened this issue Feb 21, 2024 · 3 comments

Comments

@bermell
Copy link

bermell commented Feb 21, 2024

Thanks for KMonad, it's a remarkable software!

I've noticed that Rust GUI applications (wezterm, alacritty and neovide so far) all have problems with shifted symbols in layers before the tab-hold-next-release timeout happens.

My config includes this:

 spcsym (tap-hold-next-release 300 spc (layer-toggle symbols))
...
(deflayer symbols
  _      !     ..... 
...
)

i.e.
tap spacebar -> get a space.
hold spacebar, tab q -> get !

It other non-rust programs this works as intended without issues. But in the rust programs, when I type fast I'll get a 1 when I wanted !. however, hold the spacebar, wait for a short while and then tap q, I get the intended !. The behavior is the same for all symbols that you need to hold shift to get on a traditional keyboard. for example:

  • 2 where I wanted @
  • 3 where I wanted #

etc...

Feels like Rust is more to blame than kmonad but I want to raise it here to get some pointers on where to continue the investigation.

I'm on the latest Ubuntu LTS (Ubuntu 22.04.4 LTS) with the latest release of kmonad (0.4.2).

At my desk I use Corne keyboard with ZMK connected with bluetooth that works without issues in the Rust apps.

@mdSlash
Copy link

mdSlash commented Feb 22, 2024

I encountered the same issue when using macro-shifted keys in Kitty. I resolved it by adding pause before the shifted keys.

@bermell
Copy link
Author

bermell commented Feb 22, 2024

I encountered the same issue when using macro-shifted keys in Kitty. I resolved it by adding pause before the shifted keys.

Thanks for sharing your experience! I'm currently using Kitty and it doesn't have the issue describe though I also had to add some pauses to the macros I use. Based on what you said I tried defining a new button for ! in the following ways by none them worked

(defalias
  exl (tap-macro P5 !)     ;;  just doesn't work
  exl2 (tap-macro (sticky-key 500 lsft) P20 1)    ;; doesn't work, sticky-key isn't triggered by subsequent keys in a macro, only physical key presses
)

KMonad macro system doesn't support separating pressing and releasing buttons in the same way as ZMK and QMK does. And to be clear, this is not critique and I don't think time should be invested into it, I've never thought about that feature until now, and this use case would be a very hacky work around for something that isn't even KMonad's fault.

@bermell
Copy link
Author

bermell commented Feb 24, 2024

I tried lowering the timeout of i.e.:

spcsym (tap-hold-next-release 100 spc (layer-toggle symbols))
                              ^^^

With this setting it's harder to accidentally trigger the 1 instead of ! but instead I occasionally drop some spaces. This is expected behavior of Kmonad. And I think it narrows the issues down to how KMonad and the Rust library event processing interact around the timeout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants