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

Key press / release is too fast for emacs on hyprland(wayland) #340

Closed
jixiuf opened this issue Sep 8, 2023 · 1 comment · Fixed by #341
Closed

Key press / release is too fast for emacs on hyprland(wayland) #340

jixiuf opened this issue Sep 8, 2023 · 1 comment · Fixed by #341

Comments

@jixiuf
Copy link
Contributor

jixiuf commented Sep 8, 2023

keypress_delay_ms: 10
keymap:
  - name: Emacs
    application:
      only: [emacs,Emacs]
    remap:
    # switch to english language and send C-g
      C-g: [super-Space,C-g]

same to #179 but for emacs with wayland (hyprland)

I found that adding a tiny sleep here makes it work:

diff --git a/src/event_handler.rs b/src/event_handler.rs
index 30ff952..9568ddd 100644
--- a/src/event_handler.rs
+++ b/src/event_handler.rs
@@ -527,6 +527,7 @@ impl EventHandler {
 
         // Resurrect the original modifiers
         self.send_keys(&extra_modifiers, PRESS);
+        self.send_action(Action::Delay(self.keypress_delay));
         self.send_keys(&missing_modifiers, RELEASE);
     }
 
jixiuf added a commit to jixiuf/xremap that referenced this issue Sep 8, 2023
@k0kubun
Copy link
Contributor

k0kubun commented Sep 11, 2023

Interesting. I'm open to merging that line for Wayland users. Could you make it a pull request?

jixiuf added a commit to jixiuf/xremap that referenced this issue Sep 11, 2023
jixiuf added a commit to jixiuf/xremap that referenced this issue Sep 11, 2023
jixiuf added a commit to jixiuf/xremap that referenced this issue Sep 12, 2023
k0kubun pushed a commit that referenced this issue Sep 22, 2023
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

Successfully merging a pull request may close this issue.

2 participants