Skip to content

propagate keyDown events on macOS if they are not handled in Avalonia - #20944

Closed
RaoulSeifertEnscape wants to merge 3 commits into
AvaloniaUI:mainfrom
Enscape:bugfix/macos-unhandled-keydown-event-propagation
Closed

propagate keyDown events on macOS if they are not handled in Avalonia#20944
RaoulSeifertEnscape wants to merge 3 commits into
AvaloniaUI:mainfrom
Enscape:bugfix/macos-unhandled-keydown-event-propagation

Conversation

@RaoulSeifertEnscape

Copy link
Copy Markdown

What does the pull request do?

This PR adds default keyDown event handling for keyDown events that were not handled in Avalonia.

What is the current behavior?

Currently all keyDown events are consumed and none are forwarded to the nextResponder.

What is the updated/expected behavior with this PR?

With these changes the keyDown events that were not handled in Avalonia will be passed along the responder chain

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

Should be obvious, as only simple calls to `[super keyDown:event] where added under the condition that handleKeyDown returns false.

Fixed issues

Fixes #20943

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.0.999-cibuild0063683-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia

cla-avalonia commented Mar 19, 2026

Copy link
Copy Markdown
Collaborator
  • All contributors have signed the CLA.

@RaoulSeifertEnscape

RaoulSeifertEnscape commented Mar 20, 2026

Copy link
Copy Markdown
Author

@cla-avalonia agree

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.0.999-cibuild0063785-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.0.999-cibuild0063902-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul

MrJul commented Aug 19, 2026

Copy link
Copy Markdown
Member

First, key handling on macOS has been reworked with #21906, so this PR needs to be rewritten.

Second, the changes should be conditional on whether there's really another responder. Otherwise, the default handler will just produce an annoying beep if the key is unhandled, which wasn't the case previously.

Third, the PR doesn't handle everything: modifier keys in a textbox aren't passed to the next responder, even if Avalonia doesn't handle them, which is inconsistent.

For all these reasons, I'm closing the PR.
Feel free to re-create after #21906 gets merged, with the points above addressed.

@MrJul MrJul closed this Aug 19, 2026
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.

Unhandled keyDown events are not propagated along the responder chain

4 participants