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

Remove released keys from queue. #74

Merged
merged 1 commit into from
Sep 28, 2024
Merged

Conversation

auouymous
Copy link
Contributor

Upon release, the key is removed from queue, and keys later in the queue are shifted to allow the slot to be reused. This avoids sending a second release event for released keys when the hyper key is released. It also fixes an issue where the queue can fill with released keys, preventing a 9th key from being queued.

Upon release, the key is removed from queue, and keys later in the queue
are shifted to allow the slot to be reused. This avoids sending a second
release event for released keys when the hyper key is released. It also
fixes an issue where the queue can fill with released keys, preventing a
9th key from being queued.
@donniebreve
Copy link
Owner

By adding this, you've changed the queue in to a list. Typically a queue only allows manipulation of the first element. The queue exists only to capture multiple pressed keys before seeing a key up.

  1. Is there a problem with sending some additional key ups?
  2. Is there a likely scenario where someone would press more than eight keys?

@auouymous
Copy link
Contributor Author

1. Is there a problem with sending some additional key ups?

Most of my super keys only trigger on release to avoid a repeat from activating them multiple times.

2. Is there a likely scenario where someone would press more than eight keys?

That is how I found it. I had mouse and window/screen jumping keys in my hyper keymap, and needed to release spacebar occasionally to flush the queue when it stopped accepting keys.

Doubling the queue size would solve this because even though I had every alphanumeric key bound, there is no way 16 of them would be pressed, at least in my case. But that wouldn't fix the double release issue.

@donniebreve donniebreve merged commit c74ce04 into donniebreve:main Sep 28, 2024
1 check passed
@auouymous auouymous deleted the 1000 branch September 30, 2024 00:54
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 this pull request may close these issues.

2 participants