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

This causes all one shot that were sticking to be clearer if no keys … #1276

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lgnakano
Copy link

…are pressed for a specified amount of time.

@lgnakano
Copy link
Author

This is an extra timeout to clear any sticky modes. This is useful if you walk away from the keyboard and forgot which mods were active. UOSL (https://community.keyboard.io/u/uosl) had worked on that with me, but I am not sure if it was suggested as a pull request. If you find useful AND you think others may do so, feel free to merge.

@algernon algernon added enhancement New feature or request plugin Issues related to otherwise unlisted plugins labels Oct 14, 2022
@gedankenexperimenter
Copy link
Collaborator

Apart from largely administrative issues (code style & DCO), this change is missing one crucial element: start_time_ would need to be changed from uint16_t to uint_32_t—or, perhaps preferably (I'm not sure), a different timeout mechanism should be used. On keyboards with generously-sized MCUs (e.g. Model100), using 32-bit integers is generally fine, but on the AVR boards, every little bit helps. I want to suggest storing the timeout as an integer number of seconds (or perhaps even minutes?), and keep a separate count of seconds since the last one-shot key became sticky. That comparison wouldn't need to compensate for integer overflow (unless you consider a timeout of greater than 18 hours to be reasonable, assuming the ttl and count are stored as 16-bit integers). This alternative approach might be better for the smaller MCUs, but it might just be simpler to increase the size of start_time_ and use just the one timeout-checking function.

@gedankenexperimenter
Copy link
Collaborator

This change would also need documentation and a testcase. @lgnakano, if you'd like any guidance on these things, I'm happy to assist.

@lgnakano
Copy link
Author

lgnakano commented Oct 16, 2022 via email

# Conflicts:
#	plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.cpp
#	plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin Issues related to otherwise unlisted plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants