Partager via


Implementing the Keyboard PDD List (Windows CE 5.0)

Send Feedback

The Layout Manager retrieves the list of platform-dependent driver (PDD) entry points from the g_rgpfnPddEntries global array in the keyboard driver. This array can contain any number of keyboard PDDs that the system supports. However, the first entry in the list is an exception.

You can use the device layout for the first PDD in the list for converting scan codes to virtual-key codes, when MapVirtualKey(<scan code>, 3) is called. Because the HID keyboard driver requires this call to convert AT scan codes to virtual keys, you must make the first entry for a PDD that has a full set of AT scan codes in its device layout. If the keyboard PDD in question does not do this, you must place the no operation instruction (NOP) PDD entry function, PS2_NOP_Entry, first.

Perform all of the following steps in the latest Platform Builder installation, in %_WINCEROOT%\Platform\%_TGTPLAT%\Drivers\Mykbdmouse.

To implement the keyboard PDD list

  1. Create a new directory, name it PDDList, and then add an entry for this new directory to the dirs file in %_WINCEROOT%\Platform\%_TGTPLAT%\Drivers\Mykbdmouse.

    Ensure that the directories that build your keyboard driver DLLs are last in the Dirs file. The directories that build your keyboard driver DLLs are the directories that contain EngUs1, Jpn1, Jpn2, or Kor1 in the directory name. Sometimes, these directories are placed within a DLL directory.

  2. Create a new file in the PDDList directory and name it PDDList.cpp.

  3. Add a new sources file to the PDDList directory.

    The following sources file code example is a model for the sources file in the PDDList directory.

    RELEASETYPE=PLATFORM
    
    TARGETNAME=KbdPddList
    TARGETTYPE=LIBRARY
    
    SOURCES= \
      pddlist.cpp
    
  4. Add a makefile file to the PDDList directory.

    The following example shows an example makefile file.

    !INCLUDE $(_MAKEENVROOT)\makefile.def
    
  5. In the PDDList.cpp file, implement the PDD list.

    The following code example shows how to implement the keyboard PDD list. Because this sample uses AT scan codes, the NOP PDD is not necessary.

    #include <windows.h>
    #include <keybdpdd.h>
    
    BOOL
    WINAPI
    TGTPLAT_Entry(
      UINT uiPddId,
      PFN_KEYBD_EVENT pfnKeybdEvent,
      PKEYBD_PDD *ppKeybdPdd
    );
    
    PFN_KEYBD_PDD_ENTRY g_rgpfnPddEntries[] = {
      TGTPLAT_Entry,
      NULL
    };
    

See Also

Layout Manager

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.