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

Holding a key down, then pressing a modifier key stop sending key events #12566

Closed
1 task done
AngeloMateus opened this issue Jun 1, 2024 · 1 comment
Closed
1 task done
Labels
defect [core label] vim

Comments

@AngeloMateus
Copy link
Contributor

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

For example in vim mode:

  • press j to nav down
  • press shift while holding j

The shift event is sent but stops sending j, this means to hold uppercase j you must first press shift then j
Some vim users use capital J and K for faster navigation, this also affects arrow keys, which means to select lines you must first press shift (less of an issue I think).

Holding a character and lifting shift key will send character events again.

Environment

Zed: v0.138.3 (Zed Preview)
OS: macOS 14.5.0
Memory: 16 GiB
Architecture: aarch64

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

zed/crates/gpui/src/platform/mac/window.rs line:1225

        if event.is_held {
            if lock.last_fresh_keydown.as_ref() != Some(&keydown) {
                return YES;
            }
        } else {
            lock.last_fresh_keydown = Some(keydown.clone());
        }

This seems to prevent any other key events from being triggered after pressing modifier keys, maybe this should only affect modifier keys?
Removing it fixes this particular issue but I'm not sure exactly what it aimed to solve to begin with. Maybe someone with a better understanding of this code could take a look?

-        // Ignore events from held-down keys after some of the initially-pressed keys
-        // were released.
-        if event.is_held {
-            if lock.last_fresh_keydown.as_ref() != Some(&keydown) {
-                return YES;
-            }
-        } else {
-            lock.last_fresh_keydown = Some(keydown.clone());
-        }
+        lock.last_fresh_keydown = Some(keydown.clone());

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

No response

@AngeloMateus AngeloMateus added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Jun 1, 2024
@JosephTLyons JosephTLyons added vim and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jun 5, 2024
ConradIrwin added a commit that referenced this issue Jun 14, 2024
Release Notes:

- (Fixed) Allows held down key events for modifier keys.
([#12566](#12566))

---------

Co-authored-by: Angelo <>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
@ConradIrwin
Copy link
Collaborator

Fixed by #13000

fallenwood pushed a commit to fallenwood/zed that referenced this issue Jun 18, 2024
Release Notes:

- (Fixed) Allows held down key events for modifier keys.
([zed-industries#12566](zed-industries#12566))

---------

Co-authored-by: Angelo <>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] vim
Projects
None yet
Development

No branches or pull requests

3 participants