ReactOS  0.4.13-dev-100-gc8611ae
ntddkbd.h
Go to the documentation of this file.
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 #pragma once
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #define DD_KEYBOARD_DEVICE_NAME "\\Device\\KeyboardClass"
30 #define DD_KEYBOARD_DEVICE_NAME_U L"\\Device\\KeyboardClass"
31 
32 #define IOCTL_KEYBOARD_QUERY_ATTRIBUTES \
33  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
34 
35 #define IOCTL_KEYBOARD_QUERY_INDICATORS \
36  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
37 
38 #define IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION \
39  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0020, METHOD_BUFFERED, FILE_ANY_ACCESS)
40 
41 #define IOCTL_KEYBOARD_QUERY_TYPEMATIC \
42  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS)
43 
44 #define IOCTL_KEYBOARD_SET_TYPEMATIC \
45  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0001, METHOD_BUFFERED, FILE_ANY_ACCESS)
46 
47 #define IOCTL_KEYBOARD_SET_INDICATORS \
48  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0002, METHOD_BUFFERED, FILE_ANY_ACCESS)
49 
50 #define IOCTL_KEYBOARD_INSERT_DATA \
51  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0040, METHOD_BUFFERED, FILE_ANY_ACCESS)
52 
53 #define IOCTL_KEYBOARD_QUERY_IME_STATUS \
54  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0400, METHOD_BUFFERED, FILE_ANY_ACCESS)
55 
56 #define IOCTL_KEYBOARD_SET_IME_STATUS \
57  CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0401, METHOD_BUFFERED, FILE_ANY_ACCESS)
58 
59 DEFINE_GUID(GUID_DEVINTERFACE_KEYBOARD, \
60  0x884b96c3, 0x56ef, 0x11d1, 0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd);
61 
62 #define GUID_CLASS_KEYBOARD GUID_DEVINTERFACE_KEYBOARD /* Obsolete */
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 #define KEY_TERMSRV_SET_LED 8
75 #define KEY_TERMSRV_SHADOW 0x10
76 #define KEY_TERMSRV_VKPACKET 0x20
77 
78 #define KEYBOARD_LED_INJECTED 0x8000
79 #define KEYBOARD_SHADOW 0x4000
80 #define KEYBOARD_KANA_LOCK_ON 8
81 #define KEYBOARD_CAPS_LOCK_ON 4
82 #define KEYBOARD_NUM_LOCK_ON 2
83 #define KEYBOARD_SCROLL_LOCK_ON 1
84 
85 typedef struct _KEYBOARD_INPUT_DATA {
92 
93 
99 
100 typedef struct _KEYBOARD_ID {
104 
105 #define ENHANCED_KEYBOARD(Id) ((Id).Type == 2 || (Id).Type == 4 || FAREAST_KEYBOARD(Id))
106 #define FAREAST_KEYBOARD(Id) ((Id).Type == 7 || (Id).Type == 8)
107 
112 
113 typedef struct _INDICATOR_LIST {
117 
122 
123 typedef struct _KEYBOARD_ATTRIBUTES {
133 
137 
138 typedef struct _KEYBOARD_IME_STATUS {
143 
144 #ifdef __cplusplus
145 }
146 #endif
KEYBOARD_TYPEMATIC_PARAMETERS KeyRepeatMaximum
Definition: ntddkbd.h:131
USHORT MakeCode
Definition: ntddkbd.h:114
UCHAR Type
Definition: ntddkbd.h:101
struct _INDICATOR_LIST INDICATOR_LIST
USHORT IndicatorFlags
Definition: ntddkbd.h:115
struct _KEYBOARD_IME_STATUS * PKEYBOARD_IME_STATUS
INDICATOR_LIST IndicatorList[1]
Definition: ntddkbd.h:120
struct _KEYBOARD_TYPEMATIC_PARAMETERS KEYBOARD_TYPEMATIC_PARAMETERS
USHORT NumberOfKeysTotal
Definition: ntddkbd.h:128
struct _KEYBOARD_INDICATOR_PARAMETERS KEYBOARD_INDICATOR_PARAMETERS
struct _INDICATOR_LIST * PINDICATOR_LIST
struct _KEYBOARD_TYPEMATIC_PARAMETERS * PKEYBOARD_TYPEMATIC_PARAMETERS
struct _KEYBOARD_INPUT_DATA KEYBOARD_INPUT_DATA
KEYBOARD_TYPEMATIC_PARAMETERS KeyRepeatMinimum
Definition: ntddkbd.h:130
struct _KEYBOARD_UNIT_ID_PARAMETER KEYBOARD_UNIT_ID_PARAMETER
USHORT NumberOfIndicators
Definition: ntddkbd.h:127
struct _KEYBOARD_ID * PKEYBOARD_ID
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _KEYBOARD_INPUT_DATA * PKEYBOARD_INPUT_DATA
struct _KEYBOARD_ATTRIBUTES KEYBOARD_ATTRIBUTES
struct _KEYBOARD_ATTRIBUTES * PKEYBOARD_ATTRIBUTES
KEYBOARD_ID KeyboardIdentifier
Definition: ntddkbd.h:124
struct _KEYBOARD_INDICATOR_TRANSLATION KEYBOARD_INDICATOR_TRANSLATION
UCHAR Subtype
Definition: ntddkbd.h:102
struct _KEYBOARD_INDICATOR_TRANSLATION * PKEYBOARD_INDICATOR_TRANSLATION
DEFINE_GUID(GUID_DEVINTERFACE_KEYBOARD, 0x884b96c3, 0x56ef, 0x11d1, 0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd)
struct _KEYBOARD_INDICATOR_PARAMETERS * PKEYBOARD_INDICATOR_PARAMETERS
struct _KEYBOARD_IME_STATUS KEYBOARD_IME_STATUS
USHORT NumberOfFunctionKeys
Definition: ntddkbd.h:126
unsigned short USHORT
Definition: pedump.c:61
struct _KEYBOARD_ID KEYBOARD_ID
ULONG InputDataQueueLength
Definition: ntddkbd.h:129
ULONG ExtraInformation
Definition: ntddkbd.h:90
struct _KEYBOARD_UNIT_ID_PARAMETER * PKEYBOARD_UNIT_ID_PARAMETER
unsigned int ULONG
Definition: retypes.h:1