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
Change some keys to be triggered once every key press #13883
Conversation
Darn, I liked holding down the camera button and watching the headache mode video 🤣. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that "no flashing" is an improvement, but the delay introduced by triggering on release instead of on press feels weird for me. If we do this, I suggest doing it for all "toggles" to make it more consistent and thus easier to get used to.
A different solution that wouldn't introduce a delay would be ignoring repeated press events, i.e. ignoring all press events except the first one until the next release event.
I was going to do that, but I do not have enough reasons. That might be a good reason to do it because your alternative solution is harder (at least for me) to implement. |
I just found out that my alternative solution is trivial to implement: Just replace More keys where using
|
Thank you! TIL about how |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, let's see what users think about this (will they notice?). We can always do this for more keys later, but the ones changed by this PR are the most annoying ones.
Those keys are below: - KeyType::CAMERA_MODE - KeyType::SCREENSHOT - KeyType::TOGGLE_BLOCK_BOUNDS - KeyType::TOGGLE_HUD - KeyType::MINIMAP - KeyType::TOGGLE_CHAT - KeyType::TOGGLE_FOG - KeyType::TOGGLE_DEBUG - KeyType::TOGGLE_PROFILER - KeyType::RANGESELECT Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
5c74fd3
to
34afc15
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike the function name may indicate, the action is triggered right after pressing down the key. No delay, no objections. Works on my machine.
Those keys are below: - KeyType::CAMERA_MODE - KeyType::SCREENSHOT - KeyType::TOGGLE_BLOCK_BOUNDS - KeyType::TOGGLE_HUD - KeyType::MINIMAP - KeyType::TOGGLE_CHAT - KeyType::TOGGLE_FOG - KeyType::TOGGLE_DEBUG - KeyType::TOGGLE_PROFILER - KeyType::RANGESELECT Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
Goal of the PR
This PR tries to make some keys to be triggered once every key press (using
wasKeyPressed()
).Those keys are listed below:
KeyType::CAMERA_MODE
KeyType::SCREENSHOT
KeyType::TOGGLE_BLOCK_BOUNDS
KeyType::TOGGLE_HUD
KeyType::MINIMAP
KeyType::TOGGLE_CHAT
KeyType::TOGGLE_FOG
KeyType::TOGGLE_DEBUG
KeyType::TOGGLE_PROFILER
KeyType::RANGESELECT
How does the PR work?
This PR changes the key detection from
wasKeyDown()
towasKeyPressed()
for the keys listed above. The list contains keys that might cause sudden graphical changes (or creating new image files forKeyType::SCREENSHOT
) when being pressed down continuously.Does it resolve any reported issue?
Yes, this PR tries to fix #13868 (and also some of #11900).
Does this relate to a goal in the roadmap?
Yes, this PR tries to create a better UI/UX.
To do
This PR is Ready for Review.
How to test