Skip to content

Commit 1e86c89

Browse files
committedJun 3, 2016
Input related generalisations
* Move key types into own file * Use Generalized input methods in game.cpp
1 parent 7ea4a03 commit 1e86c89

File tree

3 files changed

+223
-150
lines changed

3 files changed

+223
-150
lines changed
 

Diff for: ‎src/client/keys.h

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
Minetest
3+
Copyright (C) 2016 est31, <MTest31@outlook.com>
4+
5+
This program is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU Lesser General Public License as published by
7+
the Free Software Foundation; either version 2.1 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public License along
16+
with this program; if not, write to the Free Software Foundation, Inc.,
17+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*/
19+
20+
#ifndef KEYS_HEADER
21+
#define KEYS_HEADER
22+
23+
#include<list>
24+
25+
class KeyType {
26+
public:
27+
enum T {
28+
// Player movement
29+
FORWARD,
30+
BACKWARD,
31+
LEFT,
32+
RIGHT,
33+
JUMP,
34+
SPECIAL1,
35+
SNEAK,
36+
AUTORUN,
37+
38+
ESC,
39+
40+
// Other
41+
DROP,
42+
INVENTORY,
43+
CHAT,
44+
CMD,
45+
CONSOLE,
46+
MINIMAP,
47+
FREEMOVE,
48+
FASTMOVE,
49+
NOCLIP,
50+
CINEMATIC,
51+
SCREENSHOT,
52+
TOGGLE_HUD,
53+
TOGGLE_CHAT,
54+
TOGGLE_FORCE_FOG_OFF,
55+
TOGGLE_UPDATE_CAMERA,
56+
TOGGLE_DEBUG,
57+
TOGGLE_PROFILER,
58+
CAMERA_MODE,
59+
INCREASE_VIEWING_RANGE,
60+
DECREASE_VIEWING_RANGE,
61+
RANGESELECT,
62+
63+
QUICKTUNE_NEXT,
64+
QUICKTUNE_PREV,
65+
QUICKTUNE_INC,
66+
QUICKTUNE_DEC,
67+
68+
DEBUG_STACKS,
69+
70+
// Fake keycode for array size and internal checks
71+
INTERNAL_ENUM_COUNT
72+
73+
};
74+
};
75+
76+
typedef KeyType::T GameKeyType;
77+
78+
79+
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.