WM6 Keyboard keymap RRS feed

  • General discussion

  • Dear all,

    I am developing a windows mobile  win32 application in which i am handling the keydown, keyup and onchar events. (for example : like a notepad application). OnKeyDown i store it in a string and display in the client area using CDraw (Invalidate).(No edit control, not dialog based) The problem i face is that different keyboards offer different ascii values for the same key pressed.

    htc phone offers different values for the same key press. (say 119 for # and 120 for *), whereas palm offers different values. (How will i know * is for 's' ).

    Even worse is one htc phone has 0 / E  in its qwerty keyboard returning ascii 48

    Where as other phone has 1/E or 1/E returning ascii 49. How to handle these mapping. How does the edit control internally handles these.

     To try out i tried to write a dialog based application in which i trapped the messages going to the edit control in PreTranslateMessage.

    In some phones i got VK_PROCESS key which i disabled using IMMDisableIME(0). But still  the values remained different. Dont know how to map the ascii returned with the key present in the phone. Have done a detailed research and found oem can modify these values but still if the standard edit control can process it why is that my native win32 application cannot do it.

    There is a way to LoadKeyMap but is there a way to get the current key map so that i can find the key corresponding to the ascii generated

    Any pointers will be of great help.


    thanks and regards


    Wednesday, September 15, 2010 1:28 PM

All replies

  • got the problem resolved using IMM apis.

    hC = ImmGetContext(hWnd);
    ImmSetOpenStatus(hC, TRUE);


    hC = ImmGetContext(hWnd);
    ImmSetOpenStatus(hC, FALSE);

    Both works properly in most of the phones. But few phones models does not accept IM_NUMERIC and it gets set to default IM_SPELL.



    Monday, October 11, 2010 9:11 AM