oakmound/oak

Sometimes keys will get "stuck" likely due to oak missing/ignoring keyrelease events

Closed this issue · 7 comments

I have a few thing I suspect might be the cause of this.

  1. The recent autorepeat fix on develop
  2. Hardware keypress limit (how many keys can be pressed at a time)
    On my laptop you cannot move the mouse while keys are being pressed, although I don't recall having a similar issue with keypresses.
  3. Lag/skipped frames
200sc commented

We could test if its the autorepeat fix by seeing if it replicates on master, or with the previous fix. Are there any replication steps I can do on my side?

Not anything guaranteed to work sadly. It happens often enough that it's a problem, but not often enough that I can find a pattern. That's part of why I think it could be performance related.
The one other thing I can think of is if we had a way of deliberatly lowering performance, we could test if it's related to that.
My code is available here, if you want to test it out.

I believe I found the cause: simultaneous events. Releasing 2 keys on the same frame causes one of them to get "stuck". the easiest way to replicate this is with a flat object set across multiple keys (a quarter works good for this). pressing and releasing the object should release the keys it is on top of at the same time, triggering the glitch.

200sc commented

I'll try replicating with my linux setup.

200sc commented

I've got a replication example. Sorry for the delay on working on this.

200sc commented

This only replicates with the second solution for key repeating, which we could theoretically try to improve. At this point I'm inclined to support all three versions (key repeating on, key repeating disabled through via the x11 controller, key repeating manually filtered). None of them are perfect, but based on the research we've done, other than ditching x11 there doesn't appear to be a more correct solution.

200sc commented

I stand corrected-- this was just a bug with the second fix implementation. Hotfix incoming.