home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / programacao / cwin / c.exe / $INSTDIR / include / ddk / ntddkbd.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-12-15  |  3.8 KB  |  141 lines

  1. /*
  2.  * ntddkbd.h
  3.  *
  4.  * Keyboard IOCTL interface
  5.  *
  6.  * This file is part of the w32api package.
  7.  *
  8.  * Contributors:
  9.  *   Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
  10.  *
  11.  * THIS SOFTWARE IS NOT COPYRIGHTED
  12.  *
  13.  * This source code is offered for use in the public domain. You may
  14.  * use, modify or distribute it freely.
  15.  *
  16.  * This code is distributed in the hope that it will be useful but
  17.  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  18.  * DISCLAIMED. This includes but is not limited to warranties of
  19.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20.  *
  21.  */
  22.  
  23. #ifndef __NTDDKBD_H
  24. #define __NTDDKBD_H
  25.  
  26. #if __GNUC__ >=3
  27. #pragma GCC system_header
  28. #endif
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. #pragma pack(push,4)
  35.  
  36. #include "ntddk.h"
  37.  
  38.  
  39. #define DD_KEYBOARD_DEVICE_NAME           "\\Device\\KeyboardClass"
  40. #define DD_KEYBOARD_DEVICE_NAME_U         L"\\Device\\KeyboardClass"
  41.  
  42. #define IOCTL_KEYBOARD_QUERY_ATTRIBUTES \
  43.   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
  44.  
  45. #define IOCTL_KEYBOARD_QUERY_INDICATORS \
  46.   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
  47.  
  48. #define IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION \
  49.   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0020, METHOD_BUFFERED, FILE_ANY_ACCESS)
  50.  
  51. #define IOCTL_KEYBOARD_QUERY_TYPEMATIC \
  52.   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS)
  53.  
  54. #define IOCTL_KEYBOARD_SET_TYPEMATIC \
  55.   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0001, METHOD_BUFFERED, FILE_ANY_ACCESS)
  56.  
  57. #define IOCTL_KEYBOARD_SET_INDICATORS \
  58.   CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0002, METHOD_BUFFERED, FILE_ANY_ACCESS)
  59.  
  60.  
  61. DEFINE_GUID(GUID_DEVINTERFACE_KEYBOARD, \
  62.   0x884b96c3, 0x56ef, 0x11d1, 0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd);
  63.  
  64. #define KEYBOARD_ERROR_VALUE_BASE         10000
  65.  
  66. /* KEYBOARD_INPUT_DATA.MakeCode constants */
  67. #define KEYBOARD_OVERRUN_MAKE_CODE        0xFF
  68.  
  69. /* KEYBOARD_INPUT_DATA.Flags constants */
  70. #define KEY_MAKE                          0
  71. #define KEY_BREAK                         1
  72. #define KEY_E0                            2
  73. #define KEY_E1                            4
  74.  
  75. typedef struct _KEYBOARD_INPUT_DATA {
  76.   USHORT  UnitId;
  77.   USHORT  MakeCode;
  78.   USHORT  Flags;
  79.   USHORT  Reserved;
  80.   ULONG  ExtraInformation;
  81. } KEYBOARD_INPUT_DATA, *PKEYBOARD_INPUT_DATA;
  82.  
  83.  
  84. typedef struct _KEYBOARD_TYPEMATIC_PARAMETERS {
  85.     USHORT  UnitId;
  86.     USHORT  Rate;
  87.     USHORT  Delay;
  88. } KEYBOARD_TYPEMATIC_PARAMETERS, *PKEYBOARD_TYPEMATIC_PARAMETERS;
  89.  
  90. typedef struct _KEYBOARD_ID {
  91.     UCHAR  Type;
  92.     UCHAR  Subtype;
  93. } KEYBOARD_ID, *PKEYBOARD_ID;
  94.  
  95. #define ENHANCED_KEYBOARD(Id) ((Id).Type == 2 || (Id).Type == 4 || FAREAST_KEYBOARD(Id))
  96. #define FAREAST_KEYBOARD(Id)  ((Id).Type == 7 || (Id).Type == 8)
  97.  
  98. typedef struct _KEYBOARD_INDICATOR_PARAMETERS {
  99.   USHORT  UnitId;
  100.   USHORT  LedFlags;
  101. } KEYBOARD_INDICATOR_PARAMETERS, *PKEYBOARD_INDICATOR_PARAMETERS;
  102.  
  103. typedef struct _INDICATOR_LIST {
  104.   USHORT  MakeCode;
  105.   USHORT  IndicatorFlags;
  106. } INDICATOR_LIST, *PINDICATOR_LIST;
  107.  
  108. typedef struct _KEYBOARD_INDICATOR_TRANSLATION {
  109.   USHORT  NumberOfIndicatorKeys;
  110.   INDICATOR_LIST  IndicatorList[1];
  111. } KEYBOARD_INDICATOR_TRANSLATION, *PKEYBOARD_INDICATOR_TRANSLATION;
  112.  
  113. typedef struct _KEYBOARD_ATTRIBUTES {
  114.     KEYBOARD_ID  KeyboardIdentifier;
  115.     USHORT  KeyboardMode;
  116.     USHORT  NumberOfFunctionKeys;
  117.     USHORT  NumberOfIndicators;
  118.     USHORT  NumberOfKeysTotal;
  119.     ULONG  InputDataQueueLength;
  120.     KEYBOARD_TYPEMATIC_PARAMETERS  KeyRepeatMinimum;
  121.     KEYBOARD_TYPEMATIC_PARAMETERS  KeyRepeatMaximum;
  122. } KEYBOARD_ATTRIBUTES, *PKEYBOARD_ATTRIBUTES;
  123.  
  124. typedef struct _KEYBOARD_UNIT_ID_PARAMETER {
  125.   USHORT  UnitId;
  126. } KEYBOARD_UNIT_ID_PARAMETER, *PKEYBOARD_UNIT_ID_PARAMETER;
  127.  
  128. typedef struct _KEYBOARD_IME_STATUS {
  129.     USHORT  UnitId;
  130.     ULONG  ImeOpen;
  131.     ULONG  ImeConvMode;
  132. } KEYBOARD_IME_STATUS, *PKEYBOARD_IME_STATUS;
  133.  
  134. #pragma pack(pop)
  135.  
  136. #ifdef __cplusplus
  137. }
  138. #endif
  139.  
  140. #endif /* __NTDDKBD_H */
  141.