ReactOS  0.4.15-dev-5608-gafb953a
kbdusx.c File Reference
#include <stdarg.h>
#include <windef.h>
#include <winuser.h>
#include <ndk/kbd.h>
Include dependency graph for kbdusx.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define ROSDATA   static __attribute__((section(".data")))
 
#define VK_EMPTY   0xff /* The non-existent VK */
 
#define KNUMS   KBDNUMPAD|KBDSPECIAL /* Special + number pad */
 
#define KMEXT   KBDEXT|KBDMULTIVK /* Multi + ext */
 
#define vk_master(n, x)   { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) }
 
#define DEADTRANS(ch, accent, comp, flags)   MAKELONG(ch, accent), comp, flags
 

Functions

PKBDTABLES WINAPI KbdLayerDescriptor (VOID)
 
INT WINAPI DllMain (PVOID hinstDll, ULONG dwReason, PVOID reserved)
 

Variables

ROSDATA USHORT scancode_to_vk []
 
ROSDATA VSC_VK extcode0_to_vk []
 
ROSDATA VSC_VK extcode1_to_vk []
 
ROSDATA VK_TO_BIT modifier_keys []
 
ROSDATA MODIFIERS modifier_bits
 
ROSDATA VK_TO_WCHARS2 key_to_chars_2mod []
 
ROSDATA VK_TO_WCHARS3 key_to_chars_3mod []
 
ROSDATA VK_TO_WCHARS4 key_to_chars_4mod []
 
ROSDATA VK_TO_WCHARS5 key_to_chars_5mod []
 
ROSDATA VK_TO_WCHARS6 key_to_chars_6mod []
 
ROSDATA VK_TO_WCHARS1 keypad_numbers []
 
ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table []
 
ROSDATA VSC_LPWSTR key_names []
 
ROSDATA VSC_LPWSTR extended_key_names []
 
ROSDATA DEADKEY_LPWSTR dead_key_names []
 
ROSDATA DEADKEY dead_key []
 
ROSDATA KBDTABLES keyboard_layout_table
 

Macro Definition Documentation

◆ DEADTRANS

#define DEADTRANS (   ch,
  accent,
  comp,
  flags 
)    MAKELONG(ch, accent), comp, flags

Definition at line 363 of file kbdusx.c.

◆ KMEXT

#define KMEXT   KBDEXT|KBDMULTIVK /* Multi + ext */

Definition at line 31 of file kbdusx.c.

◆ KNUMS

#define KNUMS   KBDNUMPAD|KBDSPECIAL /* Special + number pad */

Definition at line 30 of file kbdusx.c.

◆ ROSDATA

#define ROSDATA   static __attribute__((section(".data")))

Definition at line 24 of file kbdusx.c.

◆ VK_EMPTY

#define VK_EMPTY   0xff /* The non-existent VK */

Definition at line 28 of file kbdusx.c.

◆ vk_master

#define vk_master (   n,
  x 
)    { (PVK_TO_WCHARS1)x, n, sizeof(x[0]) }

Definition at line 261 of file kbdusx.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 11 of file kbdusx.c.

Function Documentation

◆ DllMain()

INT WINAPI DllMain ( PVOID  hinstDll,
ULONG  dwReason,
PVOID  reserved 
)

Definition at line 465 of file kbdusx.c.

469 {
470  return 1;
471 }

◆ KbdLayerDescriptor()

PKBDTABLES WINAPI KbdLayerDescriptor ( VOID  )

Definition at line 460 of file kbdusx.c.

460  {
461  return &keyboard_layout_table;
462 }
ROSDATA KBDTABLES keyboard_layout_table
Definition: kbdusx.c:431

Variable Documentation

◆ dead_key

ROSDATA DEADKEY dead_key[]

Definition at line 365 of file kbdusx.c.

◆ dead_key_names

ROSDATA DEADKEY_LPWSTR dead_key_names[]
Initial value:
= {
L"\'" L"ACUTE/CEDILLA",
L"`" L"GRAVE",
L"^" L"CIRCUMFLEX",
L"\"" L"UMLAUT",
L"~" L"TILDE",
}
#define L(x)
Definition: ntvdm.h:50
#define NULL
Definition: types.h:112

Definition at line 354 of file kbdusx.c.

◆ extcode0_to_vk

ROSDATA VSC_VK extcode0_to_vk[]

Definition at line 105 of file kbdusx.c.

◆ extcode1_to_vk

ROSDATA VSC_VK extcode1_to_vk[]
Initial value:
= {
{ 0x1d, VK_PAUSE},
{ 0, 0 },
}
#define VK_PAUSE
Definition: winuser.h:2195

Definition at line 147 of file kbdusx.c.

◆ extended_key_names

ROSDATA VSC_LPWSTR extended_key_names[]
Initial value:
= {
{ 0x1c, L"Num Enter" },
{ 0x1d, L"Right Control" },
{ 0x35, L"Num /" },
{ 0x37, L"Prnt Scrn" },
{ 0x38, L"Right Alt" },
{ 0x45, L"Num Lock" },
{ 0x46, L"Break" },
{ 0x47, L"Home" },
{ 0x48, L"Up" },
{ 0x49, L"Page Up" },
{ 0x4b, L"Left" },
{ 0x4d, L"Right" },
{ 0x4f, L"End" },
{ 0x50, L"Down" },
{ 0x51, L"Page Down" },
{ 0x52, L"Insert" },
{ 0x53, L"Delete" },
{ 0x54, L"<ReactOS>" },
{ 0x56, L"Help" },
{ 0x5b, L"Left <ReactOS>" },
{ 0x5c, L"Right <ReactOS>" },
{ 0x5d, L"Application" },
{ 0, NULL }
}
#define L(x)
Definition: ntvdm.h:50
#define NULL
Definition: types.h:112

Definition at line 328 of file kbdusx.c.

◆ key_names

ROSDATA VSC_LPWSTR key_names[]

Definition at line 273 of file kbdusx.c.

◆ key_to_chars_2mod

ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[]
Initial value:
= {
{ 0xff, 0, {'`', '~'} },
{ 'F', CAPLOK, {'f', 'F'} },
{ 'G', CAPLOK, {'g', 'G'} },
{ 'H', CAPLOK, {'h', 'H'} },
{ 'J', CAPLOK, {'j', 'J'} },
{ 'K', CAPLOK, {'k', 'K'} },
{ 'X', CAPLOK, {'x', 'X'} },
{ 'V', CAPLOK, {'v', 'V'} },
{ 'B', CAPLOK, {'b', 'B'} },
{ VK_OEM_PERIOD,0, {'.', '>'} },
{ VK_DECIMAL, 0, {'.', '.'} },
{ VK_TAB, 0, {'\t','\t'}},
{ VK_ADD, 0, {'+', '+'} },
{ VK_DIVIDE, 0, {'/', '/'} },
{ VK_MULTIPLY, 0, {'*', '*'} },
{ VK_SUBTRACT, 0, {'-', '-'} },
{ 0, 0 }
}
#define VK_SUBTRACT
Definition: winuser.h:2242
#define VK_ADD
Definition: winuser.h:2240
#define VK_TAB
Definition: winuser.h:2189
#define VK_DECIMAL
Definition: winuser.h:2243
#define CAPLOK
Definition: kbd.h:118
#define VK_MULTIPLY
Definition: winuser.h:2239
#define VK_OEM_3
Definition: winuser.h:2306
#define WCH_DEAD
Definition: kbd.h:114
#define VK_DIVIDE
Definition: winuser.h:2244

Definition at line 165 of file kbdusx.c.

◆ key_to_chars_3mod

ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[]
Initial value:
= {
{ '3', 0, {'3', '#', 0x00b3} },
{ '5', 0, {'5', '%', 0x20ac} },
{ '7', 0, {'7', '&', 0x00bd} },
{ '8', 0, {'8', '*', 0x00be} },
{ '9', 0, {'9', '(', 0x2018} },
{ '0', 0, {'0', ')', 0x2019} },
{ 'R', CAPLOK, {'r', 'R', 0x00ae} },
{ 'M', CAPLOK, {'m', 'M', 0x00b5} },
{ VK_OEM_2, 0, {'/', '?', 0x00bf} },
{ 0, 0 }
}
#define CAPLOK
Definition: kbd.h:118
#define VK_OEM_2
Definition: winuser.h:2305

Definition at line 186 of file kbdusx.c.

◆ key_to_chars_4mod

ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[]
Initial value:
= {
{ '1', 0, {'1', '!', 0x00a1, 0x00b9 } },
{ '4', 0, {'4', '$', 0x00a4, 0x00a3 } },
{ VK_OEM_PLUS, 0, {'=', '+', 0x00d7, 0x00f7 } },
{ 'Q', CAPLOK|CAPLOKALTGR, {'q', 'Q', 0x00e4, 0x00c4 } },
{ 'W', CAPLOK|CAPLOKALTGR, {'w', 'W', 0x00e5, 0x00c5 } },
{ 'E', CAPLOK|CAPLOKALTGR, {'e', 'E', 0x00e9, 0x00c9 } },
{ 'T', CAPLOK|CAPLOKALTGR, {'t', 'T', 0x00fe, 0x00de } },
{ 'Y', CAPLOK|CAPLOKALTGR, {'y', 'Y', 0x00fc, 0x00dc } },
{ 'U', CAPLOK|CAPLOKALTGR, {'u', 'U', 0x00fa, 0x00da } },
{ 'I', CAPLOK|CAPLOKALTGR, {'i', 'I', 0x00ed, 0x00cd } },
{ 'O', CAPLOK|CAPLOKALTGR, {'o', 'O', 0x00f3, 0x00d3 } },
{ 'P', CAPLOK|CAPLOKALTGR, {'p', 'P', 0x00f6, 0x00d6 } },
{ 'A', CAPLOK|CAPLOKALTGR, {'a', 'A', 0x00e1, 0x00c1 } },
{ 'S', CAPLOK, {'s', 'S', 0x00df, 0x00a7 } },
{ 'D', CAPLOK|CAPLOKALTGR, {'d', 'D', 0x00f0, 0x00d0 } },
{ 'L', CAPLOK|CAPLOKALTGR, {'l', 'L', 0x00f8, 0x00d8 } },
{ VK_OEM_1, 0, {';', ':', 0x00b6, 0x00b0 } },
{ VK_OEM_7, 0, {WCH_DEAD, WCH_DEAD, 0x00b4, 0x00a8 } },
{ 0xff, 0, {'\'', '\"', WCH_NONE, WCH_NONE} },
{ 'Z', CAPLOK|CAPLOKALTGR, {'z', 'Z', 0x00e6, 0x00c6 } },
{ 'C', CAPLOK, {'c', 'C', 0x00a9, 0x00a2 } },
{ 'N', CAPLOK|CAPLOKALTGR, {'n', 'N', 0x00f1, 0x00d1 } },
{ VK_OEM_COMMA, CAPLOKALTGR, {',', '<', 0x00e7, 0x00c7 } },
{ 0, 0 }
}
#define CAPLOK
Definition: kbd.h:118
#define WCH_NONE
Definition: kbd.h:113
#define CAPLOKALTGR
Definition: kbd.h:120
#define VK_OEM_7
Definition: winuser.h:2310
#define WCH_DEAD
Definition: kbd.h:114
#define VK_OEM_1
Definition: winuser.h:2298

Definition at line 199 of file kbdusx.c.

◆ key_to_chars_5mod

ROSDATA VK_TO_WCHARS5 key_to_chars_5mod[]
Initial value:
= {
{ VK_OEM_4, 0, {'[', '{', 0x00ab, WCH_NONE, 0x001b} },
{ VK_OEM_6, 0, {']', '}', 0x00bb, WCH_NONE, 0x001d} },
{ VK_OEM_5, 0, {'\\', '|', 0x00ac, 0x00a6, 0x001c} },
{ VK_OEM_102, 0, {'\\', '|', WCH_NONE, WCH_NONE, 0x001c} },
{ VK_BACK, 0, {'\b', '\b', WCH_NONE, WCH_NONE, 0x007f} },
{ VK_ESCAPE, 0, {0x001b, 0x001b, WCH_NONE, WCH_NONE, 0x001b} },
{ VK_RETURN, 0, {'\r', '\r', WCH_NONE, WCH_NONE, '\n' } },
{ VK_SPACE, 0, {' ', ' ', WCH_NONE, WCH_NONE, ' ' } },
{ VK_CANCEL, 0, {0x0003, 0x0003, WCH_NONE, WCH_NONE, 0x0003} },
{ 0, 0 }
}
#define VK_OEM_5
Definition: winuser.h:2308
#define VK_ESCAPE
Definition: winuser.h:2204
#define VK_RETURN
Definition: winuser.h:2191
#define WCH_NONE
Definition: kbd.h:113
#define VK_OEM_4
Definition: winuser.h:2307
#define VK_OEM_6
Definition: winuser.h:2309
#define VK_CANCEL
Definition: winuser.h:2182
#define VK_BACK
Definition: winuser.h:2188
#define VK_SPACE
Definition: winuser.h:2209

Definition at line 226 of file kbdusx.c.

◆ key_to_chars_6mod

ROSDATA VK_TO_WCHARS6 key_to_chars_6mod[]
Initial value:
= {
{ '2', 0, {'2', '@', 0x00b2, WCH_NONE, WCH_NONE, 0x0000 } },
{ '6', 0, {'6', WCH_DEAD, 0x00bc, WCH_NONE, WCH_NONE, 0x001e } },
{ 0xff, 0, {WCH_NONE, '^', WCH_NONE, WCH_NONE, WCH_NONE, WCH_NONE} },
{ VK_OEM_MINUS, 0, {'-', '_', 0x00a5, WCH_NONE, WCH_NONE, 0x001f } },
{ 0, 0 }
}
#define WCH_NONE
Definition: kbd.h:113
#define WCH_DEAD
Definition: kbd.h:114

Definition at line 239 of file kbdusx.c.

◆ keyboard_layout_table

ROSDATA KBDTABLES keyboard_layout_table
Initial value:
= {
0,
0,
}
ROSDATA VSC_LPWSTR key_names[]
Definition: kbdusx.c:273
ROSDATA MODIFIERS modifier_bits
Definition: kbdusx.c:159
ROSDATA VSC_VK extcode1_to_vk[]
Definition: kbdusx.c:147
#define KLLF_ALTGR
Definition: kbd.h:91
#define MAKELONG(a, b)
Definition: typedefs.h:249
ROSDATA USHORT scancode_to_vk[]
Definition: kbdusx.c:33
ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[]
Definition: kbdusx.c:263
ROSDATA VSC_LPWSTR extended_key_names[]
Definition: kbdusx.c:328
ROSDATA DEADKEY dead_key[]
Definition: kbdusx.c:365
ROSDATA VSC_VK extcode0_to_vk[]
Definition: kbdusx.c:105
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define NULL
Definition: types.h:112
ROSDATA DEADKEY_LPWSTR dead_key_names[]
Definition: kbdusx.c:354

Definition at line 431 of file kbdusx.c.

Referenced by KbdLayerDescriptor().

◆ keypad_numbers

ROSDATA VK_TO_WCHARS1 keypad_numbers[]
Initial value:
= {
{ VK_NUMPAD0, 0, {'0'} },
{ VK_NUMPAD1, 0, {'1'} },
{ VK_NUMPAD2, 0, {'2'} },
{ VK_NUMPAD3, 0, {'3'} },
{ VK_NUMPAD4, 0, {'4'} },
{ VK_NUMPAD5, 0, {'5'} },
{ VK_NUMPAD6, 0, {'6'} },
{ VK_NUMPAD7, 0, {'7'} },
{ VK_NUMPAD8, 0, {'8'} },
{ VK_NUMPAD9, 0, {'9'} },
{ 0, 0 }
}
#define VK_NUMPAD8
Definition: winuser.h:2237
#define VK_NUMPAD0
Definition: winuser.h:2229
#define VK_NUMPAD6
Definition: winuser.h:2235
#define VK_NUMPAD5
Definition: winuser.h:2234
#define VK_NUMPAD9
Definition: winuser.h:2238
#define VK_NUMPAD3
Definition: winuser.h:2232
#define VK_NUMPAD4
Definition: winuser.h:2233
#define VK_NUMPAD7
Definition: winuser.h:2236
#define VK_NUMPAD2
Definition: winuser.h:2231
#define VK_NUMPAD1
Definition: winuser.h:2230

Definition at line 247 of file kbdusx.c.

◆ modifier_bits

ROSDATA MODIFIERS modifier_bits
Initial value:
= {
6,
{ 0, 1, 4, 5, SHFT_INVALID, SHFT_INVALID, 2, 3 }
}
#define SHFT_INVALID
Definition: kbd.h:19
ROSDATA VK_TO_BIT modifier_keys[]
Definition: kbdusx.c:152

Definition at line 159 of file kbdusx.c.

◆ modifier_keys

ROSDATA VK_TO_BIT modifier_keys[]
Initial value:
= {
{ 0, 0 }
}
#define KBDCTRL
Definition: kbd.h:15
#define KBDSHIFT
Definition: kbd.h:14
#define VK_MENU
Definition: winuser.h:2194
#define VK_SHIFT
Definition: winuser.h:2192
#define KBDALT
Definition: kbd.h:16
#define VK_CONTROL
Definition: winuser.h:2193

Definition at line 152 of file kbdusx.c.

◆ scancode_to_vk

ROSDATA USHORT scancode_to_vk[]

Definition at line 33 of file kbdusx.c.

◆ vk_to_wchar_master_table

ROSDATA VK_TO_WCHAR_TABLE vk_to_wchar_master_table[]
Initial value:
= {
{ 0,0,0 }
}
ROSDATA VK_TO_WCHARS2 key_to_chars_2mod[]
Definition: kbdusx.c:165
#define vk_master(n, x)
Definition: kbdusx.c:261
ROSDATA VK_TO_WCHARS6 key_to_chars_6mod[]
Definition: kbdusx.c:239
ROSDATA VK_TO_WCHARS5 key_to_chars_5mod[]
Definition: kbdusx.c:226
ROSDATA VK_TO_WCHARS4 key_to_chars_4mod[]
Definition: kbdusx.c:199
ROSDATA VK_TO_WCHARS3 key_to_chars_3mod[]
Definition: kbdusx.c:186
ROSDATA VK_TO_WCHARS1 keypad_numbers[]
Definition: kbdusx.c:247

Definition at line 263 of file kbdusx.c.