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

Prevent global shortcut activation from repeating on Windows #602

Merged
merged 2 commits into from
Oct 24, 2022

Conversation

kvnxiao
Copy link
Contributor

@kvnxiao kvnxiao commented Oct 23, 2022

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe: platform feature consistency

Currently, when global shortcuts are registered on Windows, the MOD_NOREPEAT flag is not included which causes the global shortcut to repeatedly activate when the key is pressed down (similar to pressing and holding a single key on the keyboard, which causes the key press to repeat). To mimic the functionality of how shortcuts are managed in other platforms, we may add the MOD_NOREPEAT flag by default.

Reference: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerhotkey

Relevant Discord thread: https://discord.com/channels/616186924390023171/807549941936816148/1033114071832207471

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

@kvnxiao kvnxiao requested a review from a team as a code owner October 23, 2022 05:48
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

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

Can you also add a changefile in .changes directory? thanks

src/platform_impl/windows/global_shortcut.rs Outdated Show resolved Hide resolved
@kvnxiao
Copy link
Contributor Author

kvnxiao commented Oct 23, 2022

@amrbashir added suggested changes and a changes .md file.

@wusyong wusyong merged commit d15a756 into tauri-apps:dev Oct 24, 2022
@github-actions github-actions bot mentioned this pull request Oct 24, 2022
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.

None yet

3 participants