What is the correct and culture-independent key handling method in WPF?

I am very confused about key handling http://msdn.microsoft.com/en-us/library/system.windows.input.key.aspx in KeyEventArgs.
For example: I want to process a colon key (made on my Italian keyboard using the + Shift point), so I write code like this

if ( e.Key == Key.OemPeriod && e.KeyboardDevice.Modifiers == ModifierKeys.Shift) {
    // Code 
}

But this approach is incorrect, because it only works with the Italian keyboard. What is the correct and culture-independent key handling method in WPF?

+3
source share
1 answer
+3

Source: https://habr.com/ru/post/1718088/


All Articles