如何确定在 Windows Phone 7 数字键盘中按下的键的值? [英] How to determine the value of key pressed in Windows Phone 7 Numeric Keyboard?
问题描述
我将事件处理程序连接到 TextBox 的 KeyDown
事件.事件处理程序有一个 KeyEventArgs
类型的参数,带有 Key
和 PlatformKeyCode
属性.问题是在windows phone 软键盘上同时按下1 和! 键,Key 和PlatformKeyCode
的值为D1
和 49
分别.我不知道按下了哪个键.另外 Keyboard.Modifiers
静态属性返回None"
I hooked up an event handler to the KeyDown
event of a TextBox. The event handler has an argument of type KeyEventArgs
with properties Key
and PlatformKeyCode
. The issue is for both the 1 and ! keys pressed on the windows phone soft keyboard, the values for Key and PlatformKeyCode
are D1
and 49
respectively. I cant tell which key was pressed. Also the Keyboard.Modifiers
static property returns "None"
那么我如何确定按下的键?
So how do I determine the key that was pressed?
推荐答案
这是一个已知问题.
KeyDown/OnKeyDown 和KeyUp/OnKeyUp 问题
您始终可以读取输入值并根据 1/!分别.
You could always read the input values instead and act on 1 / ! seperately.
这篇关于如何确定在 Windows Phone 7 数字键盘中按下的键的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!