-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Detect Shortcut: Hold Esc/Enter to Cancel/Accept #2135
Conversation
e9e3a3b
to
2b0abf9
Compare
It looks like your commits aren't linked to your GitHub ID. I think you have to set your email ID in the git config on your machine like this |
2b0abf9
to
0a7f72c
Compare
Bypass shorcut/single key remapping by holding the navigation keys
* Fix issue where Esc and Enter would not be removed in Detect Shortcut * Fix issue where Esc and Enter would behave as delayed keys in the Detect Shortcut dialog after being mapped. * Refactored duplicated code in ShortcutControl and SingleKeyRemapControl. *
41989ad
to
da25d6c
Compare
} | ||
} | ||
|
||
if (CheckIfMillisHaveElapsed(_initialHoldKeyDown, GetTickCount(), LONG_PRESS_DELAY_MILLIS)) |
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.
GetTickCount resets to 0 every 49 days. does that match the behaviour for the ev.time
?
void RegisterKeyDelay( | ||
DWORD key, | ||
std::function<void(DWORD)> onShortPress, | ||
std::function<void(DWORD)> onLongPressDetected, | ||
std::function<void(DWORD)> onLongPressReleased); | ||
|
||
void UnregisterKeyDelay(DWORD key); | ||
|
||
bool HandleKeyDelayEvent(LowlevelKeyboardEvent* ev); | ||
|
||
void SelectDetectedRemapKey(DWORD key); | ||
|
||
void SelectDetectedShortcut(DWORD key); | ||
|
||
void ResetDetectedShortcutKey(DWORD key); |
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.
Can we add the single line comments here as well?
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.
LGTM! The logic for handling the delay is really cool!
Summary of the Pull Request
Apply/Discard changes on the Detect SingleKey/Shortcut ContentDialog by holding down Enter/Escape.
References
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed