From: Norman Diamond on
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: Hui Chen (MSFT) on
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
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
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: Michael S. Kaplan [MSFT] on
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.
>>
>