annotate Keyboard.h @ 2331:9551756f46c4

Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
author Grumpy7
date Wed, 02 Apr 2014 01:21:05 +0200
parents 34035536bbf5
children 5d263539bbec
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
Ritor1
parents:
diff changeset
2
Ritor1
parents:
diff changeset
3
Ritor1
parents:
diff changeset
4 /* 284 */
Ritor1
parents:
diff changeset
5 enum InputAction : __int32
Ritor1
parents:
diff changeset
6 {
Ritor1
parents:
diff changeset
7 INPUT_MoveForward = 0x0,
Ritor1
parents:
diff changeset
8 INPUT_MoveBackwards = 0x1,
Ritor1
parents:
diff changeset
9 INPUT_TurnLeft = 0x2,
Ritor1
parents:
diff changeset
10 INPUT_TurnRight = 0x3,
Ritor1
parents:
diff changeset
11 INPUT_Yell = 0x4,
Ritor1
parents:
diff changeset
12 INPUT_Jump = 0x5,
Ritor1
parents:
diff changeset
13 INPUT_Combat = 0x6,
Ritor1
parents:
diff changeset
14 INPUT_CastReady = 0x7,
Ritor1
parents:
diff changeset
15 INPUT_Attack = 0x8,
Ritor1
parents:
diff changeset
16 INPUT_EventTrigger = 0x9,
Ritor1
parents:
diff changeset
17 INPUT_Cast = 0xA,
Ritor1
parents:
diff changeset
18 INPUT_Pass = 0xB,
Ritor1
parents:
diff changeset
19 INPUT_CharCycle = 0xC,
Ritor1
parents:
diff changeset
20 INPUT_Quest = 0xD,
Ritor1
parents:
diff changeset
21 INPUT_QuickRef = 0xE,
Ritor1
parents:
diff changeset
22 INPUT_Rest = 0xF,
Ritor1
parents:
diff changeset
23 INPUT_TimeCal = 0x10,
Ritor1
parents:
diff changeset
24 INPUT_Autonotes = 0x11,
Ritor1
parents:
diff changeset
25 INPUT_Mapbook = 0x12,
Ritor1
parents:
diff changeset
26 INPUT_AlwaysRun = 0x13,
Ritor1
parents:
diff changeset
27 INPUT_LookUp = 0x14,
Ritor1
parents:
diff changeset
28 INPUT_LookDown = 0x15,
Ritor1
parents:
diff changeset
29 INPUT_CenterView = 0x16,
Ritor1
parents:
diff changeset
30 INPUT_ZoomIn = 0x17,
Ritor1
parents:
diff changeset
31 INPUT_ZoomOut = 0x18,
Ritor1
parents:
diff changeset
32 INPUT_FlyUp = 0x19,
Ritor1
parents:
diff changeset
33 INPUT_FlyDown = 0x1A,
Ritor1
parents:
diff changeset
34 INPUT_Land = 0x1B,
Ritor1
parents:
diff changeset
35 INPUT_StrafeLeft = 0x1C,
Ritor1
parents:
diff changeset
36 INPUT_StrafeRight = 0x1D,
Ritor1
parents:
diff changeset
37 };
Ritor1
parents:
diff changeset
38
Ritor1
parents:
diff changeset
39
Ritor1
parents:
diff changeset
40
Ritor1
parents:
diff changeset
41 enum KeyToggleType : __int32
Ritor1
parents:
diff changeset
42 {
Ritor1
parents:
diff changeset
43 TOGGLE_Continuously = 0x0,
Ritor1
parents:
diff changeset
44 TOGGLE_OneTimePress = 0x1,
Ritor1
parents:
diff changeset
45 };
Ritor1
parents:
diff changeset
46
Ritor1
parents:
diff changeset
47 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
48 struct KeyboardActionMapping
Ritor1
parents:
diff changeset
49 {
Ritor1
parents:
diff changeset
50 KeyboardActionMapping();
Ritor1
parents:
diff changeset
51
Ritor1
parents:
diff changeset
52 void SetKeyMapping(int uAction, int vKey, KeyToggleType type);
Ritor1
parents:
diff changeset
53 unsigned int GetActionVKey(enum InputAction eAction);
2200
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2152
diff changeset
54 const char *GetVKeyDisplayName(unsigned char a1);
f0477fe92362 Keyboard.cpp removing the huge cases and separating data and code
Grumpy7
parents: 2152
diff changeset
55 const unsigned __int8 TranslateKeyNameToKeyCode(const char *Str);
0
Ritor1
parents:
diff changeset
56 void ReadMappings();
Ritor1
parents:
diff changeset
57 void StoreMappings();
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
58 bool ProcessTextInput(unsigned int a2);
1038
39f42990698f Cleanings
Nomad
parents: 3
diff changeset
59 void SetWindowInputStatus(int a2);
39f42990698f Cleanings
Nomad
parents: 3
diff changeset
60 void EnterText(int a2, int max_string_len, struct GUIWindow *pWindow);
0
Ritor1
parents:
diff changeset
61 void ResetKeys();
Ritor1
parents:
diff changeset
62 void SetDefaultMapping();
Ritor1
parents:
diff changeset
63
Ritor1
parents:
diff changeset
64 unsigned int uLastKeyPressed;
Ritor1
parents:
diff changeset
65 int field_4;
Ritor1
parents:
diff changeset
66 int field_8;
Ritor1
parents:
diff changeset
67 unsigned int pVirtualKeyCodesMapping[30];
Ritor1
parents:
diff changeset
68 KeyToggleType pToggleTypes[30];
1038
39f42990698f Cleanings
Nomad
parents: 3
diff changeset
69 int max_input_string_len;
0
Ritor1
parents:
diff changeset
70 unsigned __int8 pPressedKeysBuffer[257];
Ritor1
parents:
diff changeset
71 unsigned __int8 uNumKeysPressed;
Ritor1
parents:
diff changeset
72 char field_202;
Ritor1
parents:
diff changeset
73 char field_203;
Ritor1
parents:
diff changeset
74 int field_204;
Ritor1
parents:
diff changeset
75 struct GUIWindow *pWindow;
Ritor1
parents:
diff changeset
76 };
Ritor1
parents:
diff changeset
77 #pragma pack(pop)
Ritor1
parents:
diff changeset
78
Ritor1
parents:
diff changeset
79 #pragma pack(push, 1)
1103
db395ce89ede struct/class incostintency
Grumpy7
parents: 1038
diff changeset
80 class Keyboard
0
Ritor1
parents:
diff changeset
81 {
1103
db395ce89ede struct/class incostintency
Grumpy7
parents: 1038
diff changeset
82 public:
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
83 inline Keyboard():
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
84 bUsingAsynKeyboard(false)
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
85 {}
0
Ritor1
parents:
diff changeset
86 bool WasKeyPressed(int vKey);
2201
34035536bbf5 Finishing keyboard.cpp stuff
Grumpy7
parents: 2200
diff changeset
87 static bool IsKeyBeingHeld(int vKey);
2331
9551756f46c4 Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents: 2201
diff changeset
88 static void ProcessInputActions();
0
Ritor1
parents:
diff changeset
89 bool IsShiftHeld();
Ritor1
parents:
diff changeset
90 void EnterCriticalSection();
Ritor1
parents:
diff changeset
91
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1103
diff changeset
92 void ( ***vdestructor_ptr)(Keyboard *, bool);
0
Ritor1
parents:
diff changeset
93 unsigned int bUsingAsynKeyboard;
Ritor1
parents:
diff changeset
94 };
Ritor1
parents:
diff changeset
95 #pragma pack(pop)
Ritor1
parents:
diff changeset
96
Ritor1
parents:
diff changeset
97
Ritor1
parents:
diff changeset
98
Ritor1
parents:
diff changeset
99
1038
39f42990698f Cleanings
Nomad
parents: 3
diff changeset
100 extern struct KeyboardActionMapping *pKeyActionMap;