Skip to content

Conversation

@miloush
Copy link
Contributor

@miloush miloush commented Apr 17, 2023

Fixes #7641

Description

ListBox and classes derived from it (notably ListView) are expected to select all on Ctrl+/ and select item with focus on Ctrl+\. However, the implementation only checks the status of the Ctrl modifier, not the others. As a result, this shortcut hijacks any other combination of keys, most importantly Ctrl+Alt which is used for typing on around 60 keyboard layouts that Windows ships.

This PR fixes the problem by limiting the shortcuts to what has been documented in the code comments as intent, i.e. they will work only when Ctrl is pressed and nothing else.

Customer Impact

Not taking this fix prevents users from typing characters using these two keys on their keyboards into a TextBox or similar control inside ListBox or ListView.

Regression

No.

Testing

Built and verified using the repro in #7641 and Czech keyboard layout that typing is not possible without the fix and works with the fix (.NET 8.0.100-preview.3.23178.7)

Risk

Selecting all and selecting the focused item is now limited to Ctrl only, while it used to work with any modifiers combination involving Ctrl.

However, the current situation is serious - users cannot type. The former behavior is relatively easily achievable by deriving from the control and overriding OnKeyDown.

@miloush miloush requested a review from a team as a code owner April 17, 2023 09:13
@pchaurasia14
Copy link
Contributor

@miloush - #7614 points to an arcade PR. Is that the correct issue?

@miloush
Copy link
Contributor Author

miloush commented Apr 17, 2023

Sorry @pchaurasia14 fixed!

@dipeshmsft
Copy link
Member

@miloush Thanks for your continuous efforts in fixing issues via PRs and triaging.

@ghost ghost locked as resolved and limited conversation to collaborators Jul 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

French Canadian Keyboard Layout "}" key being swallowed by WPF ListView

3 participants