4 * Keyboard IOCTL interface
6 * This file is part of the w32api package.
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
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.
27 #pragma GCC system_header
36 #define DD_KEYBOARD_DEVICE_NAME "\\Device\\KeyboardClass"
37 #define DD_KEYBOARD_DEVICE_NAME_U L"\\Device\\KeyboardClass"
39 #define IOCTL_KEYBOARD_QUERY_ATTRIBUTES \
40 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
42 #define IOCTL_KEYBOARD_QUERY_INDICATORS \
43 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
45 #define IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION \
46 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0020, METHOD_BUFFERED, FILE_ANY_ACCESS)
48 #define IOCTL_KEYBOARD_QUERY_TYPEMATIC \
49 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS)
51 #define IOCTL_KEYBOARD_SET_TYPEMATIC \
52 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0001, METHOD_BUFFERED, FILE_ANY_ACCESS)
54 #define IOCTL_KEYBOARD_SET_INDICATORS \
55 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0002, METHOD_BUFFERED, FILE_ANY_ACCESS)
58 DEFINE_GUID(GUID_DEVINTERFACE_KEYBOARD
, \
59 0x884b96c3, 0x56ef, 0x11d1, 0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd);
61 #define KEYBOARD_ERROR_VALUE_BASE 10000
63 /* KEYBOARD_INPUT_DATA.MakeCode constants */
64 #define KEYBOARD_OVERRUN_MAKE_CODE 0xFF
66 /* KEYBOARD_INPUT_DATA.Flags constants */
72 typedef struct _KEYBOARD_INPUT_DATA
{
77 ULONG ExtraInformation
;
78 } KEYBOARD_INPUT_DATA
, *PKEYBOARD_INPUT_DATA
;
81 typedef struct _KEYBOARD_TYPEMATIC_PARAMETERS
{
85 } KEYBOARD_TYPEMATIC_PARAMETERS
, *PKEYBOARD_TYPEMATIC_PARAMETERS
;
87 typedef struct _KEYBOARD_ID
{
90 } KEYBOARD_ID
, *PKEYBOARD_ID
;
92 #define ENHANCED_KEYBOARD(Id) ((Id).Type == 2 || (Id).Type == 4 || FAREAST_KEYBOARD(Id))
93 #define FAREAST_KEYBOARD(Id) ((Id).Type == 7 || (Id).Type == 8)
95 typedef struct _KEYBOARD_INDICATOR_PARAMETERS
{
98 } KEYBOARD_INDICATOR_PARAMETERS
, *PKEYBOARD_INDICATOR_PARAMETERS
;
100 typedef struct _INDICATOR_LIST
{
102 USHORT IndicatorFlags
;
103 } INDICATOR_LIST
, *PINDICATOR_LIST
;
105 typedef struct _KEYBOARD_INDICATOR_TRANSLATION
{
106 USHORT NumberOfIndicatorKeys
;
107 INDICATOR_LIST IndicatorList
[1];
108 } KEYBOARD_INDICATOR_TRANSLATION
, *PKEYBOARD_INDICATOR_TRANSLATION
;
110 typedef struct _KEYBOARD_ATTRIBUTES
{
111 KEYBOARD_ID KeyboardIdentifier
;
113 USHORT NumberOfFunctionKeys
;
114 USHORT NumberOfIndicators
;
115 USHORT NumberOfKeysTotal
;
116 ULONG InputDataQueueLength
;
117 KEYBOARD_TYPEMATIC_PARAMETERS KeyRepeatMinimum
;
118 KEYBOARD_TYPEMATIC_PARAMETERS KeyRepeatMaximum
;
119 } KEYBOARD_ATTRIBUTES
, *PKEYBOARD_ATTRIBUTES
;
121 typedef struct _KEYBOARD_UNIT_ID_PARAMETER
{
123 } KEYBOARD_UNIT_ID_PARAMETER
, *PKEYBOARD_UNIT_ID_PARAMETER
;
125 typedef struct _KEYBOARD_IME_STATUS
{
129 } KEYBOARD_IME_STATUS
, *PKEYBOARD_IME_STATUS
;
135 #endif /* __NTDDKBD_H */