From: rayli1107 on
I pressed W, so I guess that would be E0 11, according to this scan
code table I'm looking at. Again, I'm not sure how to retreive scancode
at run-time.

Michael S. Kaplan [MSFT] wrote:
> What is the scan code in this case, when the VK comes back as VK_PROCESSKEY?
>
>
> --
> MichKa [Microsoft]
> NLS Collation/Locale/Keyboard Technical Lead
> Globalization Infrastructure, Fonts, and Tools
> Blog: http://blogs.msdn.com/michkap
>
>
> This posting is provided "AS IS" with
> no warranties, and confers no rights.
>
>
>
> "Norman Diamond" <ndiamond(a)community.nospam> wrote in message
> news:ef8q1Q15GHA.756(a)TK2MSFTNGP05.phx.gbl...
> > OK. Anyone else then? Please, does anyone know how to get the VK code of
> > the key that the user actually tapped? Three ways of getting the value
> > VK_PROCESSKEY have not accomplished this.
> >
> > "Norman Diamond" <ndiamond(a)community.nospam> wrote in message
> > news:%23HJKXqp4GHA.3400(a)TK2MSFTNGP04.phx.gbl...
> >> Mr./Ms. Chen,
> >>
> >> Thank you for your posting but your code does not work. Please post
> >> working code if you can, because I still need to find the key that the
> >> user actually tapped.
> >>
> >> Yes I am using Windows CE 5 (Windows Mobile 5).
> >>
> >> The value of pContext->uSavedVKey is also VK_PROCESSKEY instead of the VK
> >> code of the key that the user tapped. This is the third copy of
> >> VK_PROCESSKEY that my program obtains now.
> >>
> >> I still need to get the VK code of the key that the user actually tapped
> >> in the system input panel.
> >>
> >>
> >> "Hui Chen (MSFT)" <huichen(a)online.microsoft.com> wrote in message
> >> news:OrYdqil4GHA.3840(a)TK2MSFTNGP03.phx.gbl...
> >>> if you are using Windows CE 5, you may try this:
> >>> VkCode == ImmGetvirtualkey(hwndDlg);
> >>> if (VkCode == VK_PROCESSKEY)
> >>> {
> >>> HIMC hImc = ImmGetContext(hwndDlg);
> >>> if (hImc)
> >>> {
> >>> PINPUTCONTEXT pContext = ImmLockIMC(hImc);
> >>> if (pContext)
> >>> {
> >>> VkCode = pContext->uSavedVKey;
> >>> ImmUnlockIMC(hImc);
> >>> }
> >>> ImmReleaseContext(hwndDlg, hImc);
> >>> }
> >>> }
> >>>
> >>> --
> >>> Hui Chen [MSFT]
> >>> This posting is provided "AS IS" with no warranties, and confers no
> >>> rights.
> >>>
> >>>
> >>> "Norman Diamond" <ndiamond(a)community.nospam> wrote in message
> >>> news:%23VfGKte4GHA.4976(a)TK2MSFTNGP06.phx.gbl...
> >>>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceinternational5/html/wce50lrfimmgetvirtualkey.asp
> >>>>> Although the IME sets the virtual-key value to VK_PROCESSKEY after
> >>>>> processing a key input message, an application can recover the
> >>>>> original virtual-key value with the ImmGetVirtualKey function. This
> >>>>> function can be used only for key input messages containing the
> >>>>> VK_PROCESSKEY value.
> >>>>
> >>>> Here's my code:
> >>>> case WM_KEYDOWN:
> >>>> if (Wparam == VK_PROCESSKEY) {
> >>>> VkCode = ImmGetVirtualKey(hwndDlg);
> >>>> } else {
> >>>> VkCode = Wparam;
> >>>> }
> >>>>
> >>>> When the value of Wparam is VK_PROCESSKEY, the value returned by
> >>>> ImmGetVirtualKey is another VK_PROCESSKEY instead of the actual key
> >>>> that the user tapped in the system input panel.
> >>>>
> >>>> Is there any way to really find what key the user tapped? Hmm, I think
> >>>> so because some applications like Pocket Word can get them. So how is
> >>>> it done?
> >>>>
> >>>> If the user taps the backspace key, Esc (escape) key, etc., in the
> >>>> system input panel then the value of Wparam already the VK code of the
> >>>> key that was tapped and I didn't experiment with ImmGetVirtualKey in
> >>>> those cases. Anyway the problem is to find what key was tapped whenever
> >>>> a key was tapped.
> >>
> >

From: rayli1107 on
oops posted at the wrong place

rayli1...(a)gmail.com wrote:
> I pressed W, so I guess that would be E0 11, according to this scan
> code table I'm looking at. Again, I'm not sure how to retreive scancode
> at run-time.
>
> Michael S. Kaplan [MSFT] wrote:
> > What is the scan code in this case, when the VK comes back as VK_PROCESSKEY?
> >
> >
> > --
> > MichKa [Microsoft]
> > NLS Collation/Locale/Keyboard Technical Lead
> > Globalization Infrastructure, Fonts, and Tools
> > Blog: http://blogs.msdn.com/michkap
> >
> >
> > This posting is provided "AS IS" with
> > no warranties, and confers no rights.
> >
> >
> >
> > "Norman Diamond" <ndiamond(a)community.nospam> wrote in message
> > news:ef8q1Q15GHA.756(a)TK2MSFTNGP05.phx.gbl...
> > > OK. Anyone else then? Please, does anyone know how to get the VK code of
> > > the key that the user actually tapped? Three ways of getting the value
> > > VK_PROCESSKEY have not accomplished this.
> > >
> > > "Norman Diamond" <ndiamond(a)community.nospam> wrote in message
> > > news:%23HJKXqp4GHA.3400(a)TK2MSFTNGP04.phx.gbl...
> > >> Mr./Ms. Chen,
> > >>
> > >> Thank you for your posting but your code does not work. Please post
> > >> working code if you can, because I still need to find the key that the
> > >> user actually tapped.
> > >>
> > >> Yes I am using Windows CE 5 (Windows Mobile 5).
> > >>
> > >> The value of pContext->uSavedVKey is also VK_PROCESSKEY instead of the VK
> > >> code of the key that the user tapped. This is the third copy of
> > >> VK_PROCESSKEY that my program obtains now.
> > >>
> > >> I still need to get the VK code of the key that the user actually tapped
> > >> in the system input panel.
> > >>
> > >>
> > >> "Hui Chen (MSFT)" <huichen(a)online.microsoft.com> wrote in message
> > >> news:OrYdqil4GHA.3840(a)TK2MSFTNGP03.phx.gbl...
> > >>> if you are using Windows CE 5, you may try this:
> > >>> VkCode == ImmGetvirtualkey(hwndDlg);
> > >>> if (VkCode == VK_PROCESSKEY)
> > >>> {
> > >>> HIMC hImc = ImmGetContext(hwndDlg);
> > >>> if (hImc)
> > >>> {
> > >>> PINPUTCONTEXT pContext = ImmLockIMC(hImc);
> > >>> if (pContext)
> > >>> {
> > >>> VkCode = pContext->uSavedVKey;
> > >>> ImmUnlockIMC(hImc);
> > >>> }
> > >>> ImmReleaseContext(hwndDlg, hImc);
> > >>> }
> > >>> }
> > >>>
> > >>> --
> > >>> Hui Chen [MSFT]
> > >>> This posting is provided "AS IS" with no warranties, and confers no
> > >>> rights.
> > >>>
> > >>>
> > >>> "Norman Diamond" <ndiamond(a)community.nospam> wrote in message
> > >>> news:%23VfGKte4GHA.4976(a)TK2MSFTNGP06.phx.gbl...
> > >>>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceinternational5/html/wce50lrfimmgetvirtualkey.asp
> > >>>>> Although the IME sets the virtual-key value to VK_PROCESSKEY after
> > >>>>> processing a key input message, an application can recover the
> > >>>>> original virtual-key value with the ImmGetVirtualKey function. This
> > >>>>> function can be used only for key input messages containing the
> > >>>>> VK_PROCESSKEY value.
> > >>>>
> > >>>> Here's my code:
> > >>>> case WM_KEYDOWN:
> > >>>> if (Wparam == VK_PROCESSKEY) {
> > >>>> VkCode = ImmGetVirtualKey(hwndDlg);
> > >>>> } else {
> > >>>> VkCode = Wparam;
> > >>>> }
> > >>>>
> > >>>> When the value of Wparam is VK_PROCESSKEY, the value returned by
> > >>>> ImmGetVirtualKey is another VK_PROCESSKEY instead of the actual key
> > >>>> that the user tapped in the system input panel.
> > >>>>
> > >>>> Is there any way to really find what key the user tapped? Hmm, I think
> > >>>> so because some applications like Pocket Word can get them. So how is
> > >>>> it done?
> > >>>>
> > >>>> If the user taps the backspace key, Esc (escape) key, etc., in the
> > >>>> system input panel then the value of Wparam already the VK code of the
> > >>>> key that was tapped and I didn't experiment with ImmGetVirtualKey in
> > >>>> those cases. Anyway the problem is to find what key was tapped whenever
> > >>>> a key was tapped.
> > >>
> > >

From: Norman Diamond on
The scan code was 0.

Thank you for posting your question. I'm not sure why I didn't see your
question in this thread last week -- I had looked and seen that Hui Chen's
message was still here but didn't see yours then. Anyway, when I mentioned
in a thread started by someone else's discussion that the scan code was 0 in
my case, this was it.

I have a partial workaround for cases where we have physical keyboards to
experiment with. When a WM_CHAR message comes in, I can do a backwards
conversion to the VK code. Since Windows CE doesn't have any APIs to do
this backwards conversion, I have to compute backwards conversions either at
runtime or by experiment. Even if I can see an accurate photo of a keyboard
layout, it doesn't substitute for having a physical keyboard to experiment
with, because even if keys in the same location might have the same scan
code, they don't necessarily have the same VK code.


"Michael S. Kaplan [MSFT]" <michka(a)online.microsoft.com> wrote in message
news:OknONwc9GHA.3280(a)TK2MSFTNGP02.phx.gbl...
> What is the scan code in this case, when the VK comes back as
> VK_PROCESSKEY?
>
>
> --
> MichKa [Microsoft]
> NLS Collation/Locale/Keyboard Technical Lead
> Globalization Infrastructure, Fonts, and Tools
> Blog: http://blogs.msdn.com/michkap
>
>
> This posting is provided "AS IS" with
> no warranties, and confers no rights.
>
>
>
> "Norman Diamond" <ndiamond(a)community.nospam> wrote in message
> news:ef8q1Q15GHA.756(a)TK2MSFTNGP05.phx.gbl...
>> OK. Anyone else then? Please, does anyone know how to get the VK code
>> of the key that the user actually tapped? Three ways of getting the
>> value VK_PROCESSKEY have not accomplished this.
>>
>> "Norman Diamond" <ndiamond(a)community.nospam> wrote in message
>> news:%23HJKXqp4GHA.3400(a)TK2MSFTNGP04.phx.gbl...
>>> Mr./Ms. Chen,
>>>
>>> Thank you for your posting but your code does not work. Please post
>>> working code if you can, because I still need to find the key that the
>>> user actually tapped.
>>>
>>> Yes I am using Windows CE 5 (Windows Mobile 5).
>>>
>>> The value of pContext->uSavedVKey is also VK_PROCESSKEY instead of the
>>> VK code of the key that the user tapped. This is the third copy of
>>> VK_PROCESSKEY that my program obtains now.
>>>
>>> I still need to get the VK code of the key that the user actually tapped
>>> in the system input panel.
>>>
>>>
>>> "Hui Chen (MSFT)" <huichen(a)online.microsoft.com> wrote in message
>>> news:OrYdqil4GHA.3840(a)TK2MSFTNGP03.phx.gbl...
>>>> if you are using Windows CE 5, you may try this:
>>>> VkCode == ImmGetvirtualkey(hwndDlg);
>>>> if (VkCode == VK_PROCESSKEY)
>>>> {
>>>> HIMC hImc = ImmGetContext(hwndDlg);
>>>> if (hImc)
>>>> {
>>>> PINPUTCONTEXT pContext = ImmLockIMC(hImc);
>>>> if (pContext)
>>>> {
>>>> VkCode = pContext->uSavedVKey;
>>>> ImmUnlockIMC(hImc);
>>>> }
>>>> ImmReleaseContext(hwndDlg, hImc);
>>>> }
>>>> }
>>>>
>>>> --
>>>> Hui Chen [MSFT]
>>>> This posting is provided "AS IS" with no warranties, and confers no
>>>> rights.
>>>>
>>>>
>>>> "Norman Diamond" <ndiamond(a)community.nospam> wrote in message
>>>> news:%23VfGKte4GHA.4976(a)TK2MSFTNGP06.phx.gbl...
>>>>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceinternational5/html/wce50lrfimmgetvirtualkey.asp
>>>>>> Although the IME sets the virtual-key value to VK_PROCESSKEY after
>>>>>> processing a key input message, an application can recover the
>>>>>> original virtual-key value with the ImmGetVirtualKey function. This
>>>>>> function can be used only for key input messages containing the
>>>>>> VK_PROCESSKEY value.
>>>>>
>>>>> Here's my code:
>>>>> case WM_KEYDOWN:
>>>>> if (Wparam == VK_PROCESSKEY) {
>>>>> VkCode = ImmGetVirtualKey(hwndDlg);
>>>>> } else {
>>>>> VkCode = Wparam;
>>>>> }
>>>>>
>>>>> When the value of Wparam is VK_PROCESSKEY, the value returned by
>>>>> ImmGetVirtualKey is another VK_PROCESSKEY instead of the actual key
>>>>> that the user tapped in the system input panel.
>>>>>
>>>>> Is there any way to really find what key the user tapped? Hmm, I
>>>>> think so because some applications like Pocket Word can get them. So
>>>>> how is it done?
>>>>>
>>>>> If the user taps the backspace key, Esc (escape) key, etc., in the
>>>>> system input panel then the value of Wparam already the VK code of the
>>>>> key that was tapped and I didn't experiment with ImmGetVirtualKey in
>>>>> those cases. Anyway the problem is to find what key was tapped
>>>>> whenever a key was tapped.
>>>
>>
>
>