annotate Keyboard.h @ 253:f1218b9d67f1

merge
author Gloval
date Mon, 18 Feb 2013 09:03:15 +0400
parents bf31c505f4d3
children 39f42990698f
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);
Ritor1
parents:
diff changeset
54 const char *GetVKeyDisplayName(signed int a1);
Ritor1
parents:
diff changeset
55 const unsigned __int8 GetActionDefaultVKey(const char *Str);
Ritor1
parents:
diff changeset
56 void ReadMappings();
Ritor1
parents:
diff changeset
57 void StoreMappings();
Ritor1
parents:
diff changeset
58 bool _459F10(unsigned int a2);
Ritor1
parents:
diff changeset
59 void _459ED1(int a2);
3
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 0
diff changeset
60 void EnterText(int a2, int a3, 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];
Ritor1
parents:
diff changeset
69 int field_FC;
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)
Ritor1
parents:
diff changeset
80 struct Keyboard
Ritor1
parents:
diff changeset
81 {
Ritor1
parents:
diff changeset
82 Keyboard();
Ritor1
parents:
diff changeset
83 bool WasKeyPressed(int vKey);
Ritor1
parents:
diff changeset
84 bool IsKeyBeingHeld(int vKey);
Ritor1
parents:
diff changeset
85 bool IsShiftHeld();
Ritor1
parents:
diff changeset
86 void EnterCriticalSection();
Ritor1
parents:
diff changeset
87
Ritor1
parents:
diff changeset
88 void (__thiscall ***vdestructor_ptr)(Keyboard *, bool);
Ritor1
parents:
diff changeset
89 unsigned int bUsingAsynKeyboard;
Ritor1
parents:
diff changeset
90 };
Ritor1
parents:
diff changeset
91 #pragma pack(pop)
Ritor1
parents:
diff changeset
92
Ritor1
parents:
diff changeset
93
Ritor1
parents:
diff changeset
94 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
95 struct AsyncKeyboard
Ritor1
parents:
diff changeset
96 {
Ritor1
parents:
diff changeset
97 AsyncKeyboard();
Ritor1
parents:
diff changeset
98 ~AsyncKeyboard();
Ritor1
parents:
diff changeset
99
Ritor1
parents:
diff changeset
100 bool Initialize();
Ritor1
parents:
diff changeset
101 char map_key(int key);
Ritor1
parents:
diff changeset
102 char _45B4EC(unsigned __int8 a2);
Ritor1
parents:
diff changeset
103 void Thread();
Ritor1
parents:
diff changeset
104 char _45B3A4();
Ritor1
parents:
diff changeset
105 void Suspend();
Ritor1
parents:
diff changeset
106 void Resume();
Ritor1
parents:
diff changeset
107 char CreateDirectInputKeyboard();
Ritor1
parents:
diff changeset
108 char _45B229();
Ritor1
parents:
diff changeset
109 void _45B1B1();
Ritor1
parents:
diff changeset
110 void Release();
Ritor1
parents:
diff changeset
111
Ritor1
parents:
diff changeset
112 static int __stdcall ThreadStarter(AsyncKeyboard *pInstance);
Ritor1
parents:
diff changeset
113 static void EnterCriticalSection();
Ritor1
parents:
diff changeset
114 static void LeaveCriticalSection();
Ritor1
parents:
diff changeset
115 };
Ritor1
parents:
diff changeset
116 #pragma pack(pop)
Ritor1
parents:
diff changeset
117
Ritor1
parents:
diff changeset
118
Ritor1
parents:
diff changeset
119 extern struct KeyboardActionMapping *pKeyActionMap;
Ritor1
parents:
diff changeset
120 extern struct AsyncKeyboard *pAsyncKeyboard;