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

feat(macOS&linux): add pressed and released states #34

Merged
merged 5 commits into from
Oct 18, 2023

Conversation

chrisflatley
Copy link
Contributor

I've had look into Issue #9: separate press and release key events.

Status:

  • Macos: Tested (on arm64) and seems to work correctly.
  • Linux: Untested, but the existing logic seems sound to just add to.
  • Windows: Not implemented. AFAIK you don't get a keyup (via WM_HOTKEY) but an approach is to repeatedly check the state of each previously key. (I guess not dissimilar to the X11 version). So you only have Pressed events on Windows at the min

I've implemented the pub state as suggested in the issue, but that means existing apps will get two events when they are expecting one.

See #9.

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.

Thank you, I will add the windows implementation later, just some missing docs and this should be good to go.

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
@chrisflatley
Copy link
Contributor Author

Adding the doc was tougher than the code!

I wanted to test this in lInux but I've not had chance. I don't have a linux GUI around - not sure if VirtualBox would cut it.

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
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.

Thank you

@amrbashir amrbashir linked an issue Oct 18, 2023 that may be closed by this pull request
@amrbashir amrbashir changed the title Press and release event feat(macOS&linux): ad pressed and released states Oct 18, 2023
@amrbashir amrbashir merged commit 0e35ee3 into tauri-apps:dev Oct 18, 2023
6 checks passed
@amrbashir amrbashir changed the title feat(macOS&linux): ad pressed and released states feat(macOS&linux): add pressed and released states Oct 18, 2023
amrbashir added a commit that referenced this pull request Oct 18, 2023
amrbashir added a commit that referenced this pull request Oct 19, 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.

Support separate keydown/keyup event for hotkey
2 participants