Skip to content

Fix Windows Alt codes #18624

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

Merged
merged 1 commit into from
Apr 11, 2025
Merged

Fix Windows Alt codes #18624

merged 1 commit into from
Apr 11, 2025

Conversation

MrJul
Copy link
Member

@MrJul MrJul commented Apr 10, 2025

What does the pull request do?

This PR fixes Alt codes (alt+numpad) on Windows.
This is an alternative to #18612.

What is the current behavior?

Using Alt codes produce the wrong characters.
See #15938 for more details.

What is the updated/expected behavior with this PR?

Alt codes are correctly handled and produce the expected characters.

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

The issue was introduced in #12549, which added the KeySymbol property.
The KeySymbol is computed using Win32 ToUnicodeEx, which can mess up the keyboard state (even though we're explicitly passing a flag to avoid that...)

WM_SYSKEYDOWN/UP never produces any key symbol anyways, so this PR avoids calling ToUnicodeEx in this case.

Fixed issues

@MrJul MrJul added bug os-windows backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Apr 10, 2025
@avaloniaui-bot
Copy link

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

@maxkatz6 maxkatz6 added this pull request to the merge queue Apr 11, 2025
Merged via the queue into AvaloniaUI:master with commit 93cfa4a Apr 11, 2025
11 checks passed
@MrJul MrJul added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Apr 11, 2025
@MrJul MrJul added backported-11.3.x and removed backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Apr 12, 2025
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.

Alt+Up in TextBox adds an X character Alt codes do not produce expected characters
4 participants