Harry Harry - 1 year ago 205
C# Question

How to detect slash key using KeyDown event?

I can't find slash key in

Windows.System.Input.Key
enumeration.
Yes, I know, it's OEM key, but there is a key which produces slash on every keyboard, how can I detect it with any kind of
KeyDown
event?

Answer Source

You shouldn't.

Use the TextInput event and simply test for e.Text == "/".

(You may need to use PreviewTextInput for some controls that handle the bubbling event.)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download