How do you get the character appropriate for the given KeyDown event?

后端 未结 4 1945
粉色の甜心
粉色の甜心 2021-01-15 01:27

How do you get the character appropriate for the given KeyDown event in WPF?

4条回答
  •  悲&欢浪女
    2021-01-15 01:47

    Not all KeyDown events correspond to a single, visible character -- for instance, Backspace and Enter. You will have to compare the event arg's contents with what you want to associate. For example, on my US QUERTY keyboard, the key at the top left is a back-tick, but it might look like something else to another keyboard.

提交回复
热议问题