[go: up one dir, main page]

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

Wrong key visualization on very fast inputs #21

Open
Tonetfal opened this issue Oct 20, 2023 · 0 comments
Open

Wrong key visualization on very fast inputs #21

Tonetfal opened this issue Oct 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Tonetfal
Copy link
Owner
Tonetfal commented Oct 20, 2023

If user triggers a specific input more than once in a frame, it won't visualize it correctly.

Fix: make the visualizer be event driven to allow to somehow manually separate the rectangles.

Some direct references: void GfxButton::update(bool keyState)
That's what creates the rectangles. Move the creation from there to something that gets called on input events. When that happens, if the last rectangle is not distant enough (the distance from the origin is less than rect.height + 1) then move it at rect.height + 1 (also shift all the existing ones). That's the only way to make it separate the rectangles correctly, even though it will break a little bit the "rectangles history", as the ones pushed upwards will appear to be pressed in the past. Update still has to make the last rectangle to grow (if the input is still held).

Another way of doing that is just increasing the tick-rate the program is run at (or even make it customizable)

The key reading is not event based, hence the only way is to increase the FPS.

@Tonetfal Tonetfal added the bug Something isn't working label Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant