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

only trigger a hotkey action once per press #325

Merged

Conversation

bsstephan
Copy link
Contributor

working on 4-way joystick mode toggling in another branch, it was random whether or not I "landed" on set or unset. I identified this as the hotkey code not properly tracking lastAction.

before this change, while a hotkey was held, the action would be applied every time hotkey() was called, e.g. every millisecond, because lastAction was always NONE. this was only checked on the Y-axis toggle, but is now checked on all hotkey actions, as it also allows us from calling save() unnecessarily.

following this change I no longer experience the ambiguity on where I "land" for hotkeys that toggle a setting

working on 4-way joystick mode toggling in another branch, it was random
whether or not I "landed" on set or unset. I identified this as the
hotkey code not properly tracking lastAction.

before this change, while a hotkey was held, the action would be applied
every time hotkey() was called, e.g. every millisecond, because
lastAction was always NONE. this was only checked on the Y-axis toggle,
but is now checked on all hotkey actions, as it also allows us from
calling save() unnecessarily.

following this change I no longer experience the ambiguity on where I
"land" for hotkeys that toggle a setting
Copy link
Contributor

@arntsonl arntsonl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@arntsonl arntsonl merged commit 9c7ed02 into OpenStickCommunity:main Jun 14, 2023
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