locked
soft input panel backspace not deleting character but rather moving to previous screen RRS feed

  • Question

  • Hi,

    I have application developed to be deployed both on smart phone and toucch screen devices. When using the hard keypad on smartphone, the backspace key will naturally delete back 1 character. But this does not happen with the soft input panel on touch screen devices, it acturally moves back to previous screen. And I found no way to delete characters using the SIP.
    Any one knows the trick?
    Please help
    Thanks a lot in advance
    Tuesday, February 9, 2010 11:54 AM

Answers

  • I was facing this same problem some while back but on a smartphone. When pressing the back key on the keypad, it was moving to the previous screen. What happens is when you press the back key, the key press is not delivered to the textbox control, instead it was being handled by the application main dialog and so it was going back to the prev screen. So you need to send the 'back' key press to the text box control in order to fix this, in native code you can do this using the following:

    Under WM_INITDIALOG or WM_CREATE :
    lparam = MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY, SHMBOF_NODEFAULT | SHMBOF_NOTIFY);
    SendMessage(mbi.hwndMB, SHCMBM_OVERRIDEKEY, VK_TBACK, lparam);


    You do this after creating the menubar of your app using SHCreateMenuBar() and make sure that mbi.hwndMB is a valid handle to the menu bar window.

    Add a WM_HOTKEY case under your WndProc() for that dialog and do this:
    if(HIWORD(lParam) == VK_TBACK )
    {
         SHSendBackToFocusWindow( uMsg, wParam, lParam);
    }


    I don't know how to do the above using managed code, if you're developing in managed code then you might need to ask someone with experience in managed code.

    I found another thread about this same topic, take a look here .


    Prabhu
    Wednesday, February 10, 2010 1:27 AM

All replies

  • Hi Jane Li ,

    Can you please provide more information regarding with Control on which you are doing this operation. 

    I assume that  you are doing on textbox control, then you need to check the Focus of textbox control. If the focus is on textbox then it will work  else it will not.

    Thanks, Mohsin Shaikh. If you find my post is helpful for you then mark it as answer.
    Tuesday, February 9, 2010 11:57 AM
  • I was facing this same problem some while back but on a smartphone. When pressing the back key on the keypad, it was moving to the previous screen. What happens is when you press the back key, the key press is not delivered to the textbox control, instead it was being handled by the application main dialog and so it was going back to the prev screen. So you need to send the 'back' key press to the text box control in order to fix this, in native code you can do this using the following:

    Under WM_INITDIALOG or WM_CREATE :
    lparam = MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY, SHMBOF_NODEFAULT | SHMBOF_NOTIFY);
    SendMessage(mbi.hwndMB, SHCMBM_OVERRIDEKEY, VK_TBACK, lparam);


    You do this after creating the menubar of your app using SHCreateMenuBar() and make sure that mbi.hwndMB is a valid handle to the menu bar window.

    Add a WM_HOTKEY case under your WndProc() for that dialog and do this:
    if(HIWORD(lParam) == VK_TBACK )
    {
         SHSendBackToFocusWindow( uMsg, wParam, lParam);
    }


    I don't know how to do the above using managed code, if you're developing in managed code then you might need to ask someone with experience in managed code.

    I found another thread about this same topic, take a look here .


    Prabhu
    Wednesday, February 10, 2010 1:27 AM