-
Notifications
You must be signed in to change notification settings - Fork 22
allow users to config the escape taptime #16
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
Open
quangdn42
wants to merge
3
commits into
jasonrudolph:main
Choose a base branch
from
quangdn42:taptime-config
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
👋 @quangd42: I tried testing this locally, but it seems to always use the default value of 150 ms, even if I follow the updated instructions in the README.
I have a feeling that this is due to
hs.timer.delayed.new(self.tapTime, ...)being called inobj:init()at initialization time, and therefore any changes made toself.tapTimeafter object initialization have no effect on the timer. That's my best guess at least.If you're able to get this pull request working as desired and you can describe how to verify the new behavior, I'm happy to take another look.
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.
Thanks for looking at this. To be honest I was not so sure how to verify the delay amount of the controlKeyTimer, as hs.timer does keep an internal state for the delay amount.
So I ended up moving the initialization of the timer to the
startmethod so it's clear what value of CANCEL_DELAY is being passed to the timer, and it only happens once. Hopefully this is straightforward enough to eliminate guess work.Thanks!
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.
👋 Hi @quangd42 - I've checked out the latest updates. They do look like they should work, but I still haven't been able to definitively verify that they work. Before accepting any changes, it's important to me that I'm able to verify the new behavior. Can you describe a process for manually testing this behavior to verify that it's working as you expect?
Uh oh!
There was an error while loading. Please reload this page.
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.
Hi @jasonrudolph - In my latest commit you can find a few commented lines of code that will log elapsed time since the timer starts until either 'escape' is sent or the timer is canceled, using https://www.hammerspoon.org/docs/hs.timer.html#absoluteTime. I pushed the code as comments so that the PR can be merged as is and avoid the extra overhead.
Here are the steps:
Let me know if that will work.