ReactOS  0.4.14-dev-41-g31d7680
input.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <ndk/kbd.h>
4 
5 typedef struct tagKBDNLSLAYER
6 {
10  struct _VK_TO_FUNCTION_TABLE *pVkToF;
14 
15 typedef struct tagKBDFILE
16 {
24 } KBDFILE, *PKBDFILE;
25 
26 typedef struct tagKL
27 {
29  struct tagKL *pklNext;
30  struct tagKL *pklPrev;
39 } KL, *PKL;
40 
41 typedef struct _ATTACHINFO
42 {
47 
48 extern PATTACHINFO gpai;
49 
50 /* Keyboard layout undocumented flags */
51 #define KLF_UNLOAD 0x20000000
52 
53 /* Key States */
54 #define KS_DOWN_BIT 0x80
55 #define KS_LOCK_BIT 0x01
56 /* Scan Codes */
57 #define SC_KEY_UP 0x8000
58 /* lParam bits */
59 #define LP_DO_NOT_CARE_BIT (1<<25) // For GetKeyNameText
60 
61 /* General */
62 INIT_FUNCTION NTSTATUS NTAPI InitInputImpl(VOID);
64 BOOL FASTCALL IntBlockInput(PTHREADINFO W32Thread, BOOL BlockIt);
68 #define ThreadHasInputAccess(W32Thread) (TRUE)
69 
70 /* Keyboard */
71 INIT_FUNCTION NTSTATUS NTAPI InitKeyboardImpl(VOID);
72 VOID NTAPI UserInitKeyboard(HANDLE hKeyboardDevice);
75 BOOL NTAPI UserSendKeyboardInput(KEYBDINPUT *pKbdInput, BOOL bInjected);
78 extern int gLanguageToggleKeyState;
80 
81 /* Mouse */
84 BOOL NTAPI UserSendMouseInput(MOUSEINPUT *pMouseInput, BOOL bInjected);
85 
86 /* IMM */
88 
89 extern DWORD gSystemFS;
90 extern UINT gSystemCPCharSet;
93 extern BYTE gafAsyncKeyState[256 * 2 / 8]; // 2 bits per key
94 
95 #define GET_KS_BYTE(vk) ((vk) * 2 / 8)
96 #define GET_KS_DOWN_BIT(vk) (1 << (((vk) % 4)*2))
97 #define GET_KS_LOCK_BIT(vk) (1 << (((vk) % 4)*2 + 1))
98 #define IS_KEY_DOWN(ks, vk) (((ks)[GET_KS_BYTE(vk)] & GET_KS_DOWN_BIT(vk)) ? TRUE : FALSE)
99 #define IS_KEY_LOCKED(ks, vk) (((ks)[GET_KS_BYTE(vk)] & GET_KS_LOCK_BIT(vk)) ? TRUE : FALSE)
100 #define SET_KEY_DOWN(ks, vk, down) (ks)[GET_KS_BYTE(vk)] = ((down) ? \
101  ((ks)[GET_KS_BYTE(vk)] | GET_KS_DOWN_BIT(vk)) : \
102  ((ks)[GET_KS_BYTE(vk)] & ~GET_KS_DOWN_BIT(vk)))
103 #define SET_KEY_LOCKED(ks, vk, down) (ks)[GET_KS_BYTE(vk)] = ((down) ? \
104  ((ks)[GET_KS_BYTE(vk)] | GET_KS_LOCK_BIT(vk)) : \
105  ((ks)[GET_KS_BYTE(vk)] & ~GET_KS_LOCK_BIT(vk)))
106 
107 extern PKL gspklBaseLayout;
UINT NumOfVkToF
Definition: input.h:9
USHORT OEMIdentifier
Definition: input.h:7
BYTE gafAsyncKeyState[256 *2/8]
Definition: keyboard.c:13
INIT_FUNCTION NTSTATUS NTAPI InitKeyboardImpl(VOID)
Definition: keyboard.c:31
PTHREADINFO pti1
Definition: input.h:44
struct tagKL * pklPrev
Definition: input.h:30
struct _ATTACHINFO ATTACHINFO
BOOL NTAPI UserSendMouseInput(MOUSEINPUT *pMouseInput, BOOL bInjected)
Definition: mouse.c:168
BOOL NTAPI UserSetDefaultInputLang(HKL hKl)
Definition: kbdlayout.c:395
BOOL FASTCALL IntBlockInput(PTHREADINFO W32Thread, BOOL BlockIt)
Definition: input.c:375
PATTACHINFO gpai
Definition: input.c:17
LONG NTSTATUS
Definition: precomp.h:26
PIMEINFOEX piiex
Definition: input.h:38
UINT_PTR WPARAM
Definition: windef.h:207
VOID NTAPI UserInitKeyboard(HANDLE hKeyboardDevice)
Definition: keyboard.c:161
ULONG Size
Definition: input.h:22
struct tagKBDFILE KBDFILE
#define FASTCALL
Definition: nt_native.h:50
int32_t INT
Definition: typedefs.h:56
WORD FASTCALL UserGetMouseButtonsState(VOID)
Definition: mouse.c:22
struct tagKL * PKL
HANDLE ghKeyboardDevice
Definition: input.c:19
struct _ATTACHINFO * paiNext
Definition: input.h:43
WCHAR wchDiacritic
Definition: input.h:37
PTHREADINFO ptiRawInput
Definition: input.c:15
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
unsigned int BOOL
Definition: ntddk_ex.h:94
PTHREADINFO pti2
Definition: input.h:45
HEAD head
Definition: input.h:28
DWORD gSystemFS
Definition: kbdlayout.c:22
Definition: input.h:26
LONG_PTR LPARAM
Definition: windef.h:208
WCHAR awchKF[20]
Definition: input.h:19
UINT iBaseCharset
Definition: input.h:35
int gLanguageToggleKeyState
Definition: keyboard.c:18
Definition: ntuser.h:174
struct tagKBDNLSLAYER * PKBDNLSLAYER
struct tagKL KL
USHORT CodePage
Definition: input.h:36
__wchar_t WCHAR
Definition: xmlstorage.h:180
HKL hkl
Definition: input.h:32
Definition: kbd.h:95
struct tagKBDFILE * pkfNext
Definition: input.h:18
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
VOID NTAPI UserProcessMouseInput(PMOUSE_INPUT_DATA pMouseInputData)
Definition: mouse.c:40
PKBDNLSLAYER pKbdNlsTbl
Definition: input.h:23
INT NumOfMouseVKey
Definition: input.h:11
USHORT LayoutInformation
Definition: input.h:8
struct _KBDTABLES * pKbdTbl
Definition: input.h:21
struct _VK_TO_FUNCTION_TABLE * pVkToF
Definition: input.h:10
struct tagKBDFILE * PKBDFILE
DWORD dwKL_Flags
Definition: input.h:31
BOOL FASTCALL IsRemoveAttachThread(PTHREADINFO)
Definition: input.c:437
NTSTATUS FASTCALL UserAttachThreadInput(PTHREADINFO, PTHREADINFO, BOOL)
Definition: input.c:479
DWORD dwFontSigs
Definition: input.h:34
unsigned char BYTE
Definition: mem.h:68
UINT_PTR HKL
Definition: msctf.idl:101
struct tagKL * pklNext
Definition: input.h:29
HEAD head
Definition: input.h:17
Definition: ntuser.h:657
BOOL NTAPI UserSendKeyboardInput(KEYBDINPUT *pKbdInput, BOOL bInjected)
Definition: keyboard.c:973
VOID FASTCALL DoTheScreenSaver(VOID)
Definition: input.c:48
unsigned short USHORT
Definition: pedump.c:61
INIT_FUNCTION NTSTATUS NTAPI InitInputImpl(VOID)
Definition: input.c:360
UINT FASTCALL IntImmProcessKey(PUSER_MESSAGE_QUEUE, PWND, UINT, WPARAM, LPARAM)
Definition: ime.c:14
PKL W32kGetDefaultKeyLayout(VOID)
Definition: kbdlayout.c:343
HANDLE hBase
Definition: input.h:20
VOID NTAPI UserProcessKeyboardInput(PKEYBOARD_INPUT_DATA pKeyInput)
Definition: keyboard.c:1051
unsigned int UINT
Definition: ndis.h:50
struct tagKBDNLSLAYER KBDNLSLAYER
PUSHORT pusMouseVKey
Definition: input.h:12
PKBDFILE spkf
Definition: input.h:33
unsigned int ULONG
Definition: retypes.h:1
UINT gSystemCPCharSet
Definition: kbdlayout.c:23
KEYBOARD_ATTRIBUTES gKeyboardInfo
Definition: keyboard.c:17
struct _ATTACHINFO * PATTACHINFO
VOID NTAPI RawInputThreadMain(VOID)
Definition: input.c:124
unsigned short * PUSHORT
Definition: retypes.h:2
PKL gspklBaseLayout
Definition: kbdlayout.c:20
PKL NTAPI UserHklToKbl(HKL hKl)
Definition: kbdlayout.c:370
DWORD gdwLanguageToggleKey
Definition: keyboard.c:19