[WIN32K]
[reactos.git] / reactos / subsystems / win32 / win32k / include / input.h
1 #pragma once
2
3 #include <ndk/kbd.h>
4
5 typedef struct _KBL
6 {
7 LIST_ENTRY List;
8 DWORD Flags;
9 WCHAR Name[KL_NAMELENGTH]; // used w GetKeyboardLayoutName same as wszKLID.
10 struct _KBDTABLES* KBTables; // KBDTABLES in ndk/kbd.h
11 HANDLE hModule;
12 ULONG RefCount;
13 HKL hkl;
14 DWORD klid; // Low word - language id. High word - device id.
15 } KBL, *PKBL;
16
17 typedef struct _ATTACHINFO
18 {
19 struct _ATTACHINFO* paiNext;
20 PTHREADINFO pti1;
21 PTHREADINFO pti2;
22 } ATTACHINFO, *PATTACHINFO;
23
24 extern PATTACHINFO gpai;
25
26 #define KBL_UNLOAD 1
27 #define KBL_PRELOAD 2
28 #define KBL_RESET 4
29
30 /* Key States */
31 #define KS_DOWN_BIT 0x80
32 #define KS_LOCK_BIT 0x01
33 /* Scan Codes */
34 #define SC_KEY_UP 0x8000
35 /* lParam bits */
36 #define LP_EXT_BIT (1<<24)
37 #define LP_DO_NOT_CARE_BIT (1<<25) // for GetKeyNameText
38 #define LP_CONTEXT_BIT (1<<29)
39 #define LP_PREV_STATE_BIT (1<<30)
40 #define LP_TRANSITION_BIT (1<<31)
41
42
43 INIT_FUNCTION NTSTATUS NTAPI InitInputImpl(VOID);
44 INIT_FUNCTION NTSTATUS NTAPI InitKeyboardImpl(VOID);
45 PKBL W32kGetDefaultKeyLayout(VOID);
46 VOID NTAPI UserProcessKeyboardInput(PKEYBOARD_INPUT_DATA pKeyInput);
47 BOOL NTAPI UserSendKeyboardInput(KEYBDINPUT *pKbdInput, BOOL bInjected);
48 BOOL FASTCALL IntBlockInput(PTHREADINFO W32Thread, BOOL BlockIt);
49 BOOL FASTCALL IntMouseInput(MOUSEINPUT *mi, BOOL Injected);
50 BOOL UserInitDefaultKeyboardLayout(VOID);
51 PKBL UserHklToKbl(HKL hKl);
52 BOOL FASTCALL UserAttachThreadInput(PTHREADINFO,PTHREADINFO,BOOL);
53 VOID FASTCALL DoTheScreenSaver(VOID);
54 #define ThreadHasInputAccess(W32Thread) \
55 (TRUE)
56
57 extern HANDLE ghKeyboardDevice;
58 extern PTHREADINFO ptiRawInput;
59 extern BYTE gafAsyncKeyState[0x100];