ReactOS 0.4.15-dev-8119-g4fb2fdb
input.h
Go to the documentation of this file.
1#pragma once
2
3#include <ndk/kbd.h>
4
5typedef struct tagKBDNLSLAYER
6{
10 struct _VK_TO_FUNCTION_TABLE *pVkToF;
14
15typedef struct tagKBDFILE
16{
25
26typedef struct tagKL
27{
29 struct tagKL *pklNext;
30 struct tagKL *pklPrev;
39} KL, *PKL;
40
41typedef struct _ATTACHINFO
42{
47
48extern 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 */
64BOOL FASTCALL IntBlockInput(PTHREADINFO W32Thread, BOOL BlockIt);
68#define ThreadHasInputAccess(W32Thread) (TRUE)
69
70/* Keyboard */
72VOID NTAPI UserInitKeyboard(HANDLE hKeyboardDevice);
75BOOL NTAPI UserSendKeyboardInput(KEYBDINPUT *pKbdInput, BOOL bInjected);
82
83/* Mouse */
86BOOL NTAPI UserSendMouseInput(MOUSEINPUT *pMouseInput, BOOL bInjected);
87
88/* IMM */
91
92extern DWORD gSystemFS;
96extern BYTE gafAsyncKeyState[256 * 2 / 8]; // 2 bits per key
97
98#define GET_KS_BYTE(vk) ((vk) * 2 / 8)
99#define GET_KS_DOWN_BIT(vk) (1 << (((vk) % 4)*2))
100#define GET_KS_LOCK_BIT(vk) (1 << (((vk) % 4)*2 + 1))
101#define IS_KEY_DOWN(ks, vk) (((ks)[GET_KS_BYTE(vk)] & GET_KS_DOWN_BIT(vk)) ? TRUE : FALSE)
102#define IS_KEY_LOCKED(ks, vk) (((ks)[GET_KS_BYTE(vk)] & GET_KS_LOCK_BIT(vk)) ? TRUE : FALSE)
103#define SET_KEY_DOWN(ks, vk, down) (ks)[GET_KS_BYTE(vk)] = ((down) ? \
104 ((ks)[GET_KS_BYTE(vk)] | GET_KS_DOWN_BIT(vk)) : \
105 ((ks)[GET_KS_BYTE(vk)] & ~GET_KS_DOWN_BIT(vk)))
106#define SET_KEY_LOCKED(ks, vk, down) (ks)[GET_KS_BYTE(vk)] = ((down) ? \
107 ((ks)[GET_KS_BYTE(vk)] | GET_KS_LOCK_BIT(vk)) : \
108 ((ks)[GET_KS_BYTE(vk)] & ~GET_KS_LOCK_BIT(vk)))
109
110extern PKL gspklBaseLayout;
#define CODE_SEG(...)
LONG NTSTATUS
Definition: precomp.h:26
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
UINT_PTR HKL
Definition: msctf.idl:143
unsigned int UINT
Definition: ndis.h:50
#define FASTCALL
Definition: nt_native.h:50
unsigned short USHORT
Definition: pedump.c:61
PTHREADINFO pti2
Definition: input.h:45
struct _ATTACHINFO * paiNext
Definition: input.h:43
PTHREADINFO pti1
Definition: input.h:44
Definition: ntuser.h:180
Definition: kbd.h:95
Definition: ntuser.h:694
ULONG Size
Definition: input.h:22
HANDLE hBase
Definition: input.h:20
struct _KBDTABLES * pKbdTbl
Definition: input.h:21
PKBDNLSLAYER pKbdNlsTbl
Definition: input.h:23
struct tagKBDFILE * pkfNext
Definition: input.h:18
HEAD head
Definition: input.h:17
WCHAR awchKF[20]
Definition: input.h:19
INT NumOfMouseVKey
Definition: input.h:11
USHORT LayoutInformation
Definition: input.h:8
PUSHORT pusMouseVKey
Definition: input.h:12
USHORT OEMIdentifier
Definition: input.h:7
UINT NumOfVkToF
Definition: input.h:9
struct _VK_TO_FUNCTION_TABLE * pVkToF
Definition: input.h:10
Definition: input.h:27
DWORD dwKL_Flags
Definition: input.h:31
WCHAR wchDiacritic
Definition: input.h:37
USHORT CodePage
Definition: input.h:36
PIMEINFOEX piiex
Definition: input.h:38
DWORD dwFontSigs
Definition: input.h:34
PKBDFILE spkf
Definition: input.h:33
HEAD head
Definition: input.h:28
HKL hkl
Definition: input.h:32
struct tagKL * pklNext
Definition: input.h:29
UINT iBaseCharset
Definition: input.h:35
struct tagKL * pklPrev
Definition: input.h:30
#define NTAPI
Definition: typedefs.h:36
int32_t INT
Definition: typedefs.h:58
uint16_t * PUSHORT
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
NTSTATUS NTAPI InitInputImpl(VOID)
Definition: input.c:360
PATTACHINFO gpai
Definition: input.c:17
KEYBOARD_ATTRIBUTES gKeyboardInfo
Definition: keyboard.c:17
VOID NTAPI UserProcessKeyboardInput(PKEYBOARD_INPUT_DATA pKeyInput)
Definition: keyboard.c:1191
VOID NTAPI UserProcessMouseInput(PMOUSE_INPUT_DATA pMouseInputData)
Definition: mouse.c:40
NTSTATUS FASTCALL UserAttachThreadInput(PTHREADINFO, PTHREADINFO, BOOL)
Definition: input.c:480
WORD FASTCALL UserGetMouseButtonsState(VOID)
Definition: mouse.c:22
DWORD gSystemFS
Definition: kbdlayout.c:24
PKL gspklBaseLayout
Definition: kbdlayout.c:22
VOID FASTCALL IntFreeImeHotKeys(VOID)
Definition: ime.c:326
struct tagKBDNLSLAYER KBDNLSLAYER
INT gLayoutToggleKeyState
Definition: keyboard.c:20
BYTE gafAsyncKeyState[256 *2/8]
Definition: keyboard.c:13
UINT FASTCALL IntImmProcessKey(PUSER_MESSAGE_QUEUE, PWND, UINT, WPARAM, LPARAM)
Definition: ime.c:569
BOOL NTAPI UserSendKeyboardInput(KEYBDINPUT *pKbdInput, BOOL bInjected)
Definition: keyboard.c:1110
PKL NTAPI UserHklToKbl(HKL hKl)
Definition: kbdlayout.c:541
UINT gSystemCPCharSet
Definition: kbdlayout.c:25
DWORD gdwLanguageToggleKey
Definition: keyboard.c:19
BOOL FASTCALL IntBlockInput(PTHREADINFO W32Thread, BOOL BlockIt)
Definition: input.c:375
struct tagKBDFILE * PKBDFILE
DWORD gdwLayoutToggleKey
Definition: keyboard.c:21
struct tagKL KL
VOID FASTCALL DoTheScreenSaver(VOID)
Definition: input.c:48
HANDLE ghKeyboardDevice
Definition: input.c:19
VOID NTAPI RawInputThreadMain(VOID)
Definition: input.c:124
struct tagKL * PKL
PTHREADINFO ptiRawInput
Definition: input.c:15
BOOL NTAPI UserSendMouseInput(MOUSEINPUT *pMouseInput, BOOL bInjected)
Definition: mouse.c:168
VOID NTAPI UserInitKeyboard(HANDLE hKeyboardDevice)
Definition: keyboard.c:163
struct _ATTACHINFO * PATTACHINFO
struct tagKBDFILE KBDFILE
INT gLanguageToggleKeyState
Definition: keyboard.c:18
struct tagKBDNLSLAYER * PKBDNLSLAYER
struct _ATTACHINFO ATTACHINFO
PKL W32kGetDefaultKeyLayout(VOID)
Definition: kbdlayout.c:514
BOOL FASTCALL IsRemoveAttachThread(PTHREADINFO)
Definition: input.c:437
BOOL NTAPI UserSetDefaultInputLang(HKL hKl)
Definition: kbdlayout.c:586
NTSTATUS NTAPI InitKeyboardImpl(VOID)
Definition: keyboard.c:33
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193