Mercurial > mm7
comparison IO/Keyboard.h @ 2502:a77c34acdbc9
Media folder
author | Ritor1 |
---|---|
date | Fri, 19 Sep 2014 05:13:32 +0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2501:0ff6a9e9bf7f | 2502:a77c34acdbc9 |
---|---|
1 #pragma once | |
2 | |
3 | |
4 /* 284 */ | |
5 enum InputAction : __int32 | |
6 { | |
7 INPUT_MoveForward = 0x0, | |
8 INPUT_MoveBackwards = 0x1, | |
9 INPUT_TurnLeft = 0x2, | |
10 INPUT_TurnRight = 0x3, | |
11 INPUT_Yell = 0x4, | |
12 INPUT_Jump = 0x5, | |
13 INPUT_Combat = 0x6, | |
14 INPUT_CastReady = 0x7, | |
15 INPUT_Attack = 0x8, | |
16 INPUT_EventTrigger = 0x9, | |
17 INPUT_Cast = 0xA, | |
18 INPUT_Pass = 0xB, | |
19 INPUT_CharCycle = 0xC, | |
20 INPUT_Quest = 0xD, | |
21 INPUT_QuickRef = 0xE, | |
22 INPUT_Rest = 0xF, | |
23 INPUT_TimeCal = 0x10, | |
24 INPUT_Autonotes = 0x11, | |
25 INPUT_Mapbook = 0x12, | |
26 INPUT_AlwaysRun = 0x13, | |
27 INPUT_LookUp = 0x14, | |
28 INPUT_LookDown = 0x15, | |
29 INPUT_CenterView = 0x16, | |
30 INPUT_ZoomIn = 0x17, | |
31 INPUT_ZoomOut = 0x18, | |
32 INPUT_FlyUp = 0x19, | |
33 INPUT_FlyDown = 0x1A, | |
34 INPUT_Land = 0x1B, | |
35 INPUT_StrafeLeft = 0x1C, | |
36 INPUT_StrafeRight = 0x1D, | |
37 }; | |
38 | |
39 | |
40 | |
41 enum KeyToggleType : __int32 | |
42 { | |
43 TOGGLE_Continuously = 0x0, | |
44 TOGGLE_OneTimePress = 0x1, | |
45 }; | |
46 | |
47 #pragma pack(push, 1) | |
48 struct KeyboardActionMapping | |
49 { | |
50 KeyboardActionMapping(); | |
51 | |
52 void SetKeyMapping(int uAction, int vKey, KeyToggleType type); | |
53 unsigned int GetActionVKey(enum InputAction eAction); | |
54 const char *GetVKeyDisplayName(unsigned char a1); | |
55 const unsigned __int8 TranslateKeyNameToKeyCode(const char *Str); | |
56 void ReadMappings(); | |
57 void StoreMappings(); | |
58 bool ProcessTextInput(unsigned int a2); | |
59 void SetWindowInputStatus(int a2); | |
60 void EnterText(int a2, int max_string_len, struct GUIWindow *pWindow); | |
61 void ResetKeys(); | |
62 void SetDefaultMapping(); | |
63 | |
64 unsigned int uLastKeyPressed; | |
65 int field_4; | |
66 int field_8; | |
67 unsigned int pVirtualKeyCodesMapping[30]; | |
68 KeyToggleType pToggleTypes[30]; | |
69 int max_input_string_len; | |
70 __int8 pPressedKeysBuffer[257]; | |
71 unsigned __int8 uNumKeysPressed; | |
72 char field_202; | |
73 char field_203; | |
74 int field_204; | |
75 struct GUIWindow *pWindow; | |
76 }; | |
77 #pragma pack(pop) | |
78 | |
79 #pragma pack(push, 1) | |
80 class Keyboard | |
81 { | |
82 public: | |
83 inline Keyboard(): | |
84 bUsingAsynKeyboard(false) | |
85 {} | |
86 bool WasKeyPressed(int vKey); | |
87 static bool IsKeyBeingHeld(int vKey); | |
88 static void ProcessInputActions(); | |
89 bool IsShiftHeld(); | |
90 void EnterCriticalSection(); | |
91 | |
92 void ( ***vdestructor_ptr)(Keyboard *, bool); | |
93 unsigned int bUsingAsynKeyboard; | |
94 }; | |
95 #pragma pack(pop) | |
96 | |
97 | |
98 | |
99 void OnPressSpace(); | |
100 | |
101 extern struct KeyboardActionMapping *pKeyActionMap; |