I'm working on wpf c# application and I need to detect when user press "/" but I'm having trouble with finding " / " e.Key, I saw there is Key.OemBackslash
and stuffs like that, but I can't find right event for " / " (forward slash) ...
Thanks guys, Cheers
You can the following methods (see this site) to get the character from the key.
My old Answer:
Note that the name starts with "oem" (Original Equipment Manufacturer), which means the keyboard manufacturer is responsible for its functionality and it varies in local keyboards. So, you can set a break point in
line of my code and check e.Key property.
It should be
Key.OemQuestion
on a US keyboard. But on a Swedish keyboard it isD7
so it depends. The keys on the keyboard doesn't always produce the same character.Depending on what you are trying to do you may be better off handling the
PreviewTextInput
event: