none
keyboard problem on WCE 6 RRS feed

  • Question

  • Hi,

    i have a problem with USB hardware keyboad on Windows CE 6 ARM platform (TI AM3359). The USB host driver detects the keyboard and loads kbdhid lib. When I press and release a standard keyboard button, two keyboard events are sent to system:
    KeyboardEvent: Keybd event: vk: 0x00 sc: 0x15 flags: 0x00000000
    KeyboardEvent: Keybd event: vk: 0x00 sc: 0x15 flags: 0x00000002
    But no charakter is displayed in cmd.exe for example.

    When I run the keyboard test application (kbdtest.exe), nothing is displayed too. But I get the followin debug message:
    Message: 0x0100 - WM_KEYDOWN     wParam: 0x00000000 lParam: 0x00150001
    Message: 0x0101 - WM_KEYUP       wParam: 0x00000000 lParam: 0xc0150001

    What catalog items do I have to active? Perhaps one is missing. I have enabled following keyboard related  items:
    US Keyboard (SYSGEN_KBD_US)
    8042 Kayboard/Mouse English

    Best regards,

    Stephen

    Wednesday, May 15, 2013 11:50 AM

Answers

  • The USB HID driver relies on a GWES 'built-in' driver loaded that implements the device layout (does the scan code to virtual key translation) and an input language (virtual key to characters).
    See http://msdn.microsoft.com/en-US/library/ee481302(v=winembedded.60).aspx for details.

    If you only have a USB keyboard, you need to make sure that the NOP keyboard driver (sould be called 'kbdnopus.dll') is properly registered in the system registry under "[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\KEYBD]"

    The following thread should help to get the remaining things done: http://social.msdn.microsoft.com/Forums/en-US/winembplatdev/thread/ba5f1562-2364-4def-bab9-0bd5c95b51e1

    Using a german keyboard should work, except some keys are not mapped correctly.


    MVP Windows Embedded

    • Proposed as answer by Michael Koster Tuesday, May 21, 2013 9:14 PM
    • Marked as answer by stephen_sg Wednesday, May 22, 2013 7:30 AM
    Tuesday, May 21, 2013 9:14 PM
  • Thanks a lot Michael!

    Yesterday I found the solution too. I added this to platform.reg:

    [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\KEYBD]
        "DriverName"=-
        "DriverName"="KbdNopUs.dll"

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Layouts\00000409]
        "Layout File"=-
        "Layout File"="KbdNopUs.dll"
        "Layout Text"="US"
        "PS2_AT"=-
        "PS2_AT"="KbdNopUs.dll"

    • Marked as answer by stephen_sg Wednesday, May 22, 2013 7:30 AM
    Wednesday, May 22, 2013 7:30 AM

All replies

  • When a key down message is sent, the active keyboard *layout* is used to convert that scan code to a virtual key code (VK_ENTER, VK_UP, VK_TAB, an alphabetic character, symbol, number or whatever based on the layout of the keys on your keyboard). My guess is that you don't have the keyboard layout loaded so translation can't happen. You'll still get WM_KEYDOWN and WM_KEYUP events with the scan codes but wParam (virtual key code) will always be 0 indicating no virtual key code.

    The question becomes why isn't it loaded. You can remove 8042 since you're not using a PS/2 keyboard. You did a sysgen after adding the catalog item for US Keyboard?

    Paul T.

    Wednesday, May 15, 2013 6:47 PM
  • Thank you for your reply!

    I did a sysgen after adding the catalog item for US Keyboard.I can't remove 8042 because it is included by the US Keyboard item.

    Is it possible to debug the part where a keyboard layout should get loaded. Or where the convertion from scan code to a virtual key code is made. If yes, which libary, source file and functions is it?
    Can I check if the US Keyboard layout is loaded via a KITL tool?
    And could it be a problem that I use a german keyboard?

    I have just seen the following debug output during boot up:
    "Could not load keyboard driver dll keybddr.dll"
    I could not find anything about a keybddr.dll.

    Stephen



    • Edited by stephen_sg Thursday, May 16, 2013 11:13 AM
    Wednesday, May 15, 2013 9:39 PM
  • I found the code line in KBDHID_LIB. C:\WINCE600\public\common\oak\drivers\usb\class\hid\clients\kbdhid\kbdhid.cpp, Line 960.

        // Convert scan code to virtual key
        *puiVk = MapVirtualKey(*puiSc, MAP_SC_TO_VK);

    I debuged it. When I press Q character on keyboard, *puiSc is 0x15. But MapVirtualKey returns 0x0.

    Why? Do I have to initialize the MapVirtualKey functionality somehow, so the function knows how to map?

    Thursday, May 16, 2013 2:43 PM
  • The USB HID driver relies on a GWES 'built-in' driver loaded that implements the device layout (does the scan code to virtual key translation) and an input language (virtual key to characters).
    See http://msdn.microsoft.com/en-US/library/ee481302(v=winembedded.60).aspx for details.

    If you only have a USB keyboard, you need to make sure that the NOP keyboard driver (sould be called 'kbdnopus.dll') is properly registered in the system registry under "[HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\KEYBD]"

    The following thread should help to get the remaining things done: http://social.msdn.microsoft.com/Forums/en-US/winembplatdev/thread/ba5f1562-2364-4def-bab9-0bd5c95b51e1

    Using a german keyboard should work, except some keys are not mapped correctly.


    MVP Windows Embedded

    • Proposed as answer by Michael Koster Tuesday, May 21, 2013 9:14 PM
    • Marked as answer by stephen_sg Wednesday, May 22, 2013 7:30 AM
    Tuesday, May 21, 2013 9:14 PM
  • Thanks a lot Michael!

    Yesterday I found the solution too. I added this to platform.reg:

    [HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\KEYBD]
        "DriverName"=-
        "DriverName"="KbdNopUs.dll"

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Layouts\00000409]
        "Layout File"=-
        "Layout File"="KbdNopUs.dll"
        "Layout Text"="US"
        "PS2_AT"=-
        "PS2_AT"="KbdNopUs.dll"

    • Marked as answer by stephen_sg Wednesday, May 22, 2013 7:30 AM
    Wednesday, May 22, 2013 7:30 AM