Skip to content

Fix TextServicesManager scan code forwarding for TSF#11644

Open
calisto-le wants to merge 1 commit into
dotnet:mainfrom
calisto-le:fix/11635-tsf-scancode
Open

Fix TextServicesManager scan code forwarding for TSF#11644
calisto-le wants to merge 1 commit into
dotnet:mainfrom
calisto-le:fix/11635-tsf-scancode

Conversation

@calisto-le
Copy link
Copy Markdown

@calisto-le calisto-le commented May 15, 2026

Fixes #11635

Description

TextServicesManager currently passes 0 as the scan code for almost all keys when forwarding keystrokes to TSF.

This change forwards keyArgs.ScanCode instead, so the scan-code bits in the lParam passed to TextServicesContext.Keystroke are populated correctly.

Existing LeftShift/RightShift special handling remains unchanged.

Customer Impact

Text services, IMEs, or TIPs that rely on scan-code information will receive the correct scan code instead of just 0.

Regression

No. The issue reports this as not being a regression.

Testing

.\build.cmd -pack -plat x64 -test

Tested with a sample TextBox application using locally built WPF assemblies.

Verified that scancode matches keyArgs.ScanCode.

Risk

Low.
The change only forwards the existing scan code value.
If there is any more testing to do please let me know.

Extended Flag in lParam?

The lParam should include the extended flag for correct identifaction of all keys. Should this be added here of a seperate issue?

if (keyArgs.IsExtendedKey)
{
    lParam |= 1 << 24;
}
Microsoft Reviewers: Open in CodeFlow

@calisto-le calisto-le requested a review from a team May 15, 2026 15:38
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.

Scancode not passed to TSF

1 participant