如何确定在 Windows Phone 7 数字键盘中按下的键的值? [英] How to determine the value of key pressed in Windows Phone 7 Numeric Keyboard?

查看:31
本文介绍了如何确定在 Windows Phone 7 数字键盘中按下的键的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将事件处理程序连接到 TextBox 的 KeyDown 事件.事件处理程序有一个 KeyEventArgs 类型的参数,带有 KeyPlatformKeyCode 属性.问题是在windows phone 软键盘上同时按下1! 键,Key 和PlatformKeyCode 的值为D149 分别.我不知道按下了哪个键.另外 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆