donniebreve / touchcursor-linux

TouchCursor style keyboard remapping for Linux.
GNU General Public License v2.0
133 stars 28 forks source link

Remove released keys from queue. #74

Open auouymous opened 2 months ago

auouymous commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago
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.