简体   繁体   English

如何确定WP7 SIP键盘何时被解除

[英]How to determine when the WP7 SIP keyboard has been dismissed

I've noticed that when the SIP keyboard is displayed, the OnBackKeyPress event isn't fired when the user dismisses the keyboard via the WP7 back button. 我注意到,当显示SIP键盘时,当用户通过WP7后退按钮关闭键盘时,不会触发OnBackKeyPress事件。

Is there a way for me to determine when the keyboard has been dismissed via the back button? 有没有办法让我通过后退按钮确定键盘何时被解除?

Thanks 谢谢

You can handle the textbox's KeyUp event and then check the PlatformKeyCode . 您可以处理文本框的KeyUp事件,然后检查PlatformKeyCode

 <TextBox Text="TextBox" Width="460" KeyUp="Textbox_KeyUp" />

Then, in your event handler: 然后,在您的事件处理程序中:

private void Textbox_KeyUp(object sender, KeyEventArgs e)
{
     //27 is the PKC for the hardware back button
     if (e.PlatformKeyCode == 27)
     {
         //Backbutton is pressed
     }            
}

Check for LostFocus event on TextBox . 检查TextBox上的LostFocus事件。 Maybe it can be suitable for you (but it also will fire when a user tap outside of TextBox ) 也许它可能适合你(但当用户点击TextBox之外它也会触发)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM