0

The default behaviour of pressing back button when a textbox is on focus is that the virtual keyboard closes and the textbox loses focus. And the user press back key again, the window goes back to previous window.

However, I want the change this behavior. I want the window to go back to previous window directly when the back key is pressed, ignoring whether the textbox is on focus or not.

I tried the following methods,

  1. Use HardwareButtons.BackPressed event, doesn't work (maybe it only works for Direct3D, I am not sure). The event isn't fired during back button pressed.

  2. Use Textbox_onKeyUp, doesn't work. The event isn't fired during back button is up.

  3. Use override void OnBackKeyPress, doesn't work. It does fire as expected during other cases, but during the situation when the textbox is from on focus to losing focus (the keyboard closes), the event isn't fired.

  4. Use Textbox_OnLoseFocus, works fine but need a lot of condition checks because some times losing focus doesn't mean that I want to go back to previous page.

Please help. Thanks.

4
  • 2
    That's expected behavior and would likely irk your users instead of being useful. Feb 5, 2013 at 1:33
  • Hi Austin, if you use Nokia map, and click Search button, a Popup window comes out, then you press back button directly, the Popup window cloeses immediately instead of closing input first. I believe in the situation when you have only one textbox, let users press twice will be too troublesome.
    – user534498
    Feb 5, 2013 at 1:40
  • I agree with @AustinSalonen I don't know how Microsoft would react to this, if you tried this on iOS your app would most likely be rejected. Feb 5, 2013 at 1:53
  • Hi evanmcdonnal, then why nokia map can do this?
    – user534498
    Feb 5, 2013 at 2:04

1 Answer 1

0

Finally I didn't change the behaviour, made a different design. But I still think that in that case, the Nokia's behaviour is most user-friendly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.