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

[Mac] Fix keyDown event #13280

Merged
merged 8 commits into from Oct 18, 2023
Merged

Conversation

Gillibald
Copy link
Contributor

@Gillibald Gillibald commented Oct 17, 2023

What does the pull request do?

This PR makes sure we don't raise a keyDown for the space character when IME is active.
This also makes sure we don't raise a text input event when an input modifier is pressed.

What is the current behavior?

What is the updated/expected behavior with this PR?

Flow

flowchart TD
    EventArrived[Event arrived] --> IsImeEnabled(TextInputClient exists for the control?)--> |Yes| CheckModifierKey
    CheckModifierKey(Modifier key pressed?) --> |Yes| HandleAppModifierKey
    HandleAppModifierKey[Pass event to the app] --> CheckAppHandledModifierKey(App handled the event?) --> |Yes| End
    CheckAppHandledModifierKey --> |No| HandleImeWithModifierKey[Pass the event to IME] --> End
    CheckModifierKey --> |No| HandleImeWithoutModifierKey
    HandleImeWithoutModifierKey[Pass the event IME] --> CheckImeHandledWithoutModifierKey
    CheckImeHandledWithoutModifierKey(IME handled the event?) --> |Yes| End
    CheckImeHandledWithoutModifierKey --> |No| PassToAppWithoutModifierKey[Pass the event to the app] --> End
    IsImeEnabled --> |No| PassEventToAppWithoutIme[Pass the event to the app] --> CheckAppHandledEventWithoutIme
    CheckAppHandledEventWithoutIme(App handled the event?) --> |Yes| End
    CheckAppHandledEventWithoutIme --> TriggerSimpleKeyEvent(Map key to char and raise TextInput) --> End

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

@jmacato jmacato added this pull request to the merge queue Oct 17, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 17, 2023
@Gillibald Gillibald changed the title [Mac] Fix keyDown event [WIP][Mac] Fix keyDown event Oct 17, 2023
@Gillibald Gillibald changed the title [WIP][Mac] Fix keyDown event [Mac] Fix keyDown event Oct 17, 2023
@danwalmsley danwalmsley added this pull request to the merge queue Oct 18, 2023
Merged via the queue into AvaloniaUI:master with commit 26035be Oct 18, 2023
6 checks passed
@Gillibald Gillibald deleted the fixes/macDoubleSpace branch January 30, 2024 13:22
@maxkatz6 maxkatz6 added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Feb 8, 2024
maxkatz6 pushed a commit that referenced this pull request Feb 8, 2024
* [Mac] Check for space key when keyDown isn't consumed

* [Mac] Make sure no text input event is send when a modifier is pressed

* [Mac] Refactor keyDown handling

* Move ignoreUserInput

* Handle keyDown for doCommandSelector
#Conflicts:
#	native/Avalonia.Native/src/OSX/AvnView.mm
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants