Alt + Key on Textbox with non-English keyboard should add letter but it doesn't

379 Views Asked by At

On a german keyboard you would add [ by pressing Alt+8 and ] via Alt+9. This is not working in a WPF textbox or richtextbox.

When creating a new application and adding textbox, the combinations using the right Alt key are working, not the combinations for the left Alt key.

Adding the textbox to a usercontrol and a toolbar and putting everything inside of a scrollviewer also disables the right Alt key combinations.

My workaround is for now to add an event handler for the previewkeydown event and add the characters code-wise. However, that does not feel right. I assume that I am missing something very basic here but cannot find it. All methods I found lead to a full deactivation of the Alt key functionality. Would appreciate if somebody could give me a hint.

1

There are 1 best solutions below

1
On

When using the German (DE) Keyboard layout you MUST use the Right Alt key and NOT the Left Alt key and then press 8 or 9.

This is how Microsoft Windows configures other coutries keyboards. The Left Alt serves as the Windows Alt Key while the right is dedicated to special characters.

You need the a "windows" alt key for windows key combinations like Control + Alt + Delete, Alt + Tab, etc.