Skip to content

Conversation

@CryZe
Copy link
Contributor

@CryZe CryZe commented Mar 3, 2025

This state is now provided as an argument to the event handler, such that the user can decide whether to react to the global shortcut being released or not.

The global shortcuts are otherwise also triggering when the hotkey is
being released. This affects at least Windows.
@CryZe CryZe requested a review from a team as a code owner March 3, 2025 22:13
@jkelleyrtp
Copy link
Member

I feel like the handlers should still be called and the selection is done in user code. Someone might want to handle released events?

@CryZe
Copy link
Contributor Author

CryZe commented Mar 4, 2025

That would require public API changes, but I can definitely implement it that way.

@CryZe CryZe changed the title Only react to hotkeys that are pressed Provide HotkeyState on Global Shortcut Events Mar 10, 2025
Instead of ignoring the events where the shortcut is released, the state
is now provided as an argument to the event handler.
@CryZe
Copy link
Contributor Author

CryZe commented Mar 14, 2025

This should be ready to be reviewed again. It includes the breaking changes now.

Copy link
Member

@jkelleyrtp jkelleyrtp 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! Sorry this sat for so long.

@jkelleyrtp jkelleyrtp merged commit 3da821d into DioxusLabs:main Apr 9, 2025
17 checks passed
@CryZe CryZe deleted the hotkey-pressed branch April 9, 2025 18:04
AnteDeliria pushed a commit to AnteDeliria/dioxus that referenced this pull request Jun 2, 2025
* Only react to hotkeys that are pressed

The global shortcuts are otherwise also triggering when the hotkey is
being released. This affects at least Windows.

* Provide `HotkeyState` on Global Shortcut Events

Instead of ignoring the events where the shortcut is released, the state
is now provided as an argument to the event handler.
AnteDeliria pushed a commit to AnteDeliria/dioxus that referenced this pull request Jun 3, 2025
* Only react to hotkeys that are pressed

The global shortcuts are otherwise also triggering when the hotkey is
being released. This affects at least Windows.

* Provide `HotkeyState` on Global Shortcut Events

Instead of ignoring the events where the shortcut is released, the state
is now provided as an argument to the event handler.
AnteDeliria pushed a commit to AnteDeliria/dioxus that referenced this pull request Jul 23, 2025
* Only react to hotkeys that are pressed

The global shortcuts are otherwise also triggering when the hotkey is
being released. This affects at least Windows.

* Provide `HotkeyState` on Global Shortcut Events

Instead of ignoring the events where the shortcut is released, the state
is now provided as an argument to the event handler.
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.

2 participants