ReactOS 0.4.15-dev-7842-g558ab78
tmapldr.h
Go to the documentation of this file.
1
2// //
3// File format : //
4// //
5// Comments with a ; in column 1 //
6// Empty Lines ignored //
7// The words are separated by a space, a tab, or a plus ("+") //
8// //
9// First a [GLOBAL] section : //
10// [GLOBAL] //
11// VK_F1 112 //
12// . //
13// . //
14// [END_GLOBAL] //
15// //
16// The GLOBAL section defines the names of the keys //
17// and the virtual key code they have. //
18// If you repeat a name you'll overwrite the code. //
19// You can name the keys anything you like //
20// The Virtual key nymber must be in Decimal //
21// After the number you can put anything : it is ignored //
22// Here you must put ALL the keys you'll use in the //
23// other sections. //
24// //
25// Then the emulations sections : //
26// //
27// [SCO_ANSI] //
28// //
29// VK_F1 \027[M or //
30// VK_F1 ^[[M or //
31// VK_F1 SHIFT ^[[W etc //
32// . //
33// . //
34// [SCO_ANSI_END] //
35// //
36// There are three parts : //
37// a) the key name //
38// b) the shift state //
39// here you put compination of the words : //
40// //
41// RIGHT_ALT //
42// LEFT_ALT //
43// RIGHT_CTRL //
44// LEFT_CTRL //
45// SHIFT //
46// NUMLOCK //
47// SCROLLLOCK //
48// CAPSLOCK //
49// ENHANCED //
50// APP_KEY //
51// c) the assigned string : //
52// you can use the ^ for esc (^[ = 0x1b) //
53// \ and a three digit decimal number //
54// (\027) //
55// You can't use the NULL !!! //
56// Also (for the moment) you can't use spaces //
57// in the string : everything after the 3rd word is //
58// ignored - use unsderscore instead. //
59// //
60// for example : //
61// //
62// VK_F4 SHIFT+LEFT_ALT \0274m^[[M = 0x1b 4 m 0x1b [ M //
63// VK_F1 RIGHT_CTRL This_is_ctrl_f1 //
64// //
65// You may have as many sections as you like //
66// If you repeat any section (even the GLOBAL) you'll overwrite //
67// the common parts. //
68// //
70
71#pragma once
72
73//#include "keytrans.h"
74//#include "tcharmap.h"
75
76// AVS
78
80public:
81 TMapLoader(KeyTranslator &RefKeyTrans, TCharmap &RefCharmap):
82 KeyTrans(RefKeyTrans), Charmap(RefCharmap) {}
84
85 // If called more than once the new map replaces the old one.
86 // load with a different KeysetName to change keysets
87 // Return 0 on error
88 int Load(const char * filename, const char * szKeysetName);
89
90 void Display();
91private:
94
95 int LookForPart(stringArray& sa, const char* partType, const char* partName);
96 char* ParseKeyDef(const char* buf, WORD& vk_code, DWORD& control);
97
98 int LoadGlobal(string& buf);
99 int LoadKeyMap(string buf);
100 int LoadCharMap(string buf);
101
102};
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
char * ParseKeyDef(const char *buf, WORD &vk_code, DWORD &control)
Definition: tmapldr.cpp:292
int LoadKeyMap(string buf)
Definition: tmapldr.cpp:319
TCharmap & Charmap
Definition: tmapldr.h:93
int LookForPart(stringArray &sa, const char *partType, const char *partName)
Definition: tmapldr.cpp:240
~TMapLoader()
Definition: tmapldr.h:83
TMapLoader(KeyTranslator &RefKeyTrans, TCharmap &RefCharmap)
Definition: tmapldr.h:81
KeyTranslator & KeyTrans
Definition: tmapldr.h:92
int LoadCharMap(string buf)
Definition: tmapldr.cpp:385
int Load(const char *filename, const char *szKeysetName)
Definition: tmapldr.cpp:466
void Display()
Definition: tmapldr.cpp:741
int LoadGlobal(string &buf)
Definition: tmapldr.cpp:260
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
const char * filename
Definition: ioapi.h:137
TArrayAsVector< string > stringArray
Definition: tmapldr.h:77