RigsofRods
Soft-body Physics Simulation
InputEngine.cpp
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2005-2012 Pierre-Michel Ricordel
4  Copyright 2007-2012 Thomas Fischer
5  Copyright 2013-2023 Petr Ohlidal
6 
7  For more information, see http://www.rigsofrods.org/
8 
9  Rigs of Rods is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License version 3, as
11  published by the Free Software Foundation.
12 
13  Rigs of Rods is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #include "InputEngine.h"
23 
24 #include "Actor.h"
25 #include "AppContext.h"
26 #include "Console.h"
27 #include "ContentManager.h"
28 #include "GUIManager.h"
29 #include "Language.h"
30 
31 #include <regex>
32 
33 using namespace RoR;
34 
35 const char* mOISDeviceType[6] = {"Unknown Device", "Keyboard", "Mouse", "JoyStick", "Tablet", "Other Device"};
36 
38  // Common: generic
39  {"COMMON_ACCELERATE_SIMULATION", EV_COMMON_ACCELERATE_SIMULATION, "Keyboard CTRL+EQUALS", _LC("InputEvent", "accelerate the simulation")},
40  {"COMMON_DECELERATE_SIMULATION", EV_COMMON_DECELERATE_SIMULATION, "Keyboard SHIFT+EQUALS", _LC("InputEvent", "decelerate the simulation")},
41  {"COMMON_RESET_SIMULATION_PACE", EV_COMMON_RESET_SIMULATION_PACE, "Keyboard BACKSLASH", _LC("InputEvent", "reset the simulation pace")},
42  {"COMMON_OUTPUT_POSITION", EV_COMMON_OUTPUT_POSITION, "Keyboard H", _LC("InputEvent", "write current position to log (you can open the logfile and reuse the position)")},
43  {"COMMON_QUIT_GAME", EV_COMMON_QUIT_GAME, "Keyboard EXPL+ESCAPE", _LC("InputEvent", "exit the game")},
44  {"COMMON_QUICKLOAD", EV_COMMON_QUICKLOAD, "Keyboard MULTIPLY", _LC("InputEvent", "quickload scene")},
45  {"COMMON_QUICKSAVE", EV_COMMON_QUICKSAVE, "Keyboard DIVIDE", _LC("InputEvent", "quicksave scene")},
46  {"COMMON_SCREENSHOT", EV_COMMON_SCREENSHOT, "Keyboard EXPL+SYSRQ", _LC("InputEvent", "take a screenshot")},
47  {"COMMON_SCREENSHOT_BIG", EV_COMMON_SCREENSHOT_BIG, "Keyboard EXPL+CTRL+SYSRQ", _LC("InputEvent", "take a big screenshot (3 times the screen size)")},
48  {"COMMON_TOGGLE_MAT_DEBUG", EV_COMMON_TOGGLE_MAT_DEBUG, "", _LC("InputEvent", "debug purpose - dont use")},
49  {"COMMON_TOGGLE_PHYSICS", EV_COMMON_TOGGLE_PHYSICS, "Keyboard EXPL+J", _LC("InputEvent", "enable or disable physics")},
50  {"COMMON_FOV_LESS", EV_COMMON_FOV_LESS, "Keyboard EXPL+NUMPAD7", _LC("InputEvent", "decreases the current FOV value")},
51  {"COMMON_FOV_MORE", EV_COMMON_FOV_MORE, "Keyboard EXPL+CTRL+NUMPAD7", _LC("InputEvent", "increase the current FOV value")},
52  {"COMMON_FOV_RESET", EV_COMMON_FOV_RESET, "Keyboard EXPL+SHIFT+NUMPAD7", _LC("InputEvent", "reset the FOV value")},
53  {"COMMON_SAVE_TERRAIN", EV_COMMON_SAVE_TERRAIN, "Keyboard EXPL+ALT+SHIF+CTRL+M",_LC("InputEvent", "save the currently loaded terrain to a mesh file")},
54  {"COMMON_TOGGLE_TERRAIN_EDITOR", EV_COMMON_TOGGLE_TERRAIN_EDITOR, "Keyboard EXPL+SHIFT+Y", _LC("InputEvent", "toggle terrain editor")},
55  {"COMMON_FULLSCREEN_TOGGLE", EV_COMMON_FULLSCREEN_TOGGLE, "Keyboard EXPL+ALT+RETURN", _LC("InputEvent", "toggle between windowed and fullscreen mode")},
56 
57  // Comon: actor interaction
58  {"COMMON_ENTER_OR_EXIT_TRUCK", EV_COMMON_ENTER_OR_EXIT_TRUCK, "Keyboard RETURN", _LC("InputEvent", "enter or exit a truck")},
59  {"COMMON_ENTER_NEXT_TRUCK", EV_COMMON_ENTER_NEXT_TRUCK, "Keyboard EXPL+CTRL+RBRACKET", _LC("InputEvent", "enter next truck")},
60  {"COMMON_ENTER_PREVIOUS_TRUCK", EV_COMMON_ENTER_PREVIOUS_TRUCK, "Keyboard EXPL+CTRL+LBRACKET", _LC("InputEvent", "enter previous truck")},
61  {"COMMON_REMOVE_CURRENT_TRUCK", EV_COMMON_REMOVE_CURRENT_TRUCK, "Keyboard EXPL+CTRL+DELETE", _LC("InputEvent", "remove current truck")},
62  {"COMMON_TRUCK_REMOVE", EV_COMMON_TRUCK_REMOVE, "Keyboard EXPL+CTRL+SHIFT+DELETE",_LC("InputEvent", "delete current truck")},
63  {"COMMON_RESPAWN_LAST_TRUCK", EV_COMMON_RESPAWN_LAST_TRUCK, "Keyboard EXPL+CTRL+PERIOD", _LC("InputEvent", "respawn last truck")},
64  {"COMMON_GET_NEW_VEHICLE", EV_COMMON_GET_NEW_VEHICLE, "Keyboard EXPL+CTRL+G", _LC("InputEvent", "get new vehicle")},
65  {"COMMON_PRESSURE_LESS", EV_COMMON_PRESSURE_LESS, "Keyboard LBRACKET", _LC("InputEvent", "decrease tire pressure (note: only very few trucks support this)")},
66  {"COMMON_PRESSURE_MORE", EV_COMMON_PRESSURE_MORE, "Keyboard RBRACKET", _LC("InputEvent", "increase tire pressure (note: only very few trucks support this)")},
67  {"COMMON_LOCK", EV_COMMON_LOCK, "Keyboard EXPL+L", _LC("InputEvent", "connect hook node to a node in close proximity")},
68  {"COMMON_AUTOLOCK", EV_COMMON_AUTOLOCK, "Keyboard EXPL+ALT+L", _LC("InputEvent", "unlock autolock hook node")},
69  {"COMMON_ROPELOCK", EV_COMMON_ROPELOCK, "Keyboard EXPL+CTRL+L", _LC("InputEvent", "connect a rope to a node in close proximity")},
70  {"COMMON_REPAIR_TRUCK", EV_COMMON_REPAIR_TRUCK, "Keyboard BACK", _LC("InputEvent", "repair truck")},
71  {"COMMON_LIVE_REPAIR_MODE", EV_COMMON_LIVE_REPAIR_MODE, "Keyboard ALT+BACK", _LC("InputEvent", "toggle truck interactive repair mode")},
72  {"COMMON_RESCUE_TRUCK", EV_COMMON_RESCUE_TRUCK, "Keyboard EXPL+R", _LC("InputEvent", "teleport to rescue truck")},
73  {"COMMON_RESET_TRUCK", EV_COMMON_RESET_TRUCK, "Keyboard I", _LC("InputEvent", "reset truck to original starting position")},
74  {"COMMON_TOGGLE_RESET_MODE", EV_COMMON_TOGGLE_RESET_MODE, "Keyboard EXPL+APOSTROPHE", _LC("InputEvent", "toggle reset mode")},
75  {"COMMON_SECURE_LOAD", EV_COMMON_SECURE_LOAD, "Keyboard O", _LC("InputEvent", "tie a load to the truck")},
76  {"COMMON_TOGGLE_TRUCK_BEACONS", EV_COMMON_TOGGLE_TRUCK_BEACONS, "Keyboard M", _LC("InputEvent", "toggle truck beacons")},
77  {"COMMON_TOGGLE_TRUCK_LOW_BEAMS", EV_COMMON_TOGGLE_TRUCK_LOW_BEAMS, "Keyboard EXPL+N", _LC("InputEvent", "toggle truck low beams")},
78  {"COMMON_CYCLE_TRUCK_LIGHTS", EV_COMMON_CYCLE_TRUCK_LIGHTS, "Keyboard EXPL+CTRL+N", _LC("InputEvent", "cycle between light modes")},
79  {"COMMON_TOGGLE_TRUCK_HIGH_BEAMS",EV_COMMON_TOGGLE_TRUCK_HIGH_BEAMS,"Keyboard EXPL+SHIFT+N", _LC("InputEvent", "toggle truck high beams")},
80  {"COMMON_TOGGLE_TRUCK_FOG_LIGHTS",EV_COMMON_TOGGLE_TRUCK_FOG_LIGHTS,"Keyboard EXPL+ALT+N", _LC("InputEvent", "toggle truck fog lights")},
81  {"COMMON_TOGGLE_CUSTOM_PARTICLES",EV_COMMON_TOGGLE_CUSTOM_PARTICLES,"Keyboard G", _LC("InputEvent", "toggle particle cannon")},
82  {"COMMON_TOGGLE_REPLAY_MODE", EV_COMMON_TOGGLE_REPLAY_MODE, "Keyboard EXPL+CTRL+J", _LC("InputEvent", "enable or disable replay mode")},
83  {"COMMON_REPLAY_FORWARD", EV_COMMON_REPLAY_FORWARD, "Keyboard EXPL+RIGHT", _LC("InputEvent", "more replay forward")},
84  {"COMMON_REPLAY_BACKWARD", EV_COMMON_REPLAY_BACKWARD, "Keyboard EXPL+LEFT", _LC("InputEvent", "more replay backward")},
85  {"COMMON_REPLAY_FAST_FORWARD", EV_COMMON_REPLAY_FAST_FORWARD, "Keyboard EXPL+SHIFT+RIGHT", _LC("InputEvent", "move replay fast forward")},
86  {"COMMON_REPLAY_FAST_BACKWARD", EV_COMMON_REPLAY_FAST_BACKWARD, "Keyboard EXPL+SHIFT+LEFT", _LC("InputEvent", "move replay fast backward")},
87 
88  // Common: UI
89  {"COMMON_CONSOLE_TOGGLE", EV_COMMON_CONSOLE_TOGGLE, "Keyboard EXPL+GRAVE", _LC("InputEvent", "show / hide the console")},
90  {"COMMON_ENTER_CHATMODE", EV_COMMON_ENTER_CHATMODE, "Keyboard EXPL+Y", _LC("InputEvent", "enter the chat")},
91  {"COMMON_SEND_CHAT", EV_COMMON_SEND_CHAT, "Keyboard RETURN", _LC("InputEvent", "sends the entered text")},
92  {"COMMON_HIDE_GUI", EV_COMMON_HIDE_GUI, "Keyboard EXPL+U", _LC("InputEvent", "hide all GUI elements")},
93  {"COMMON_TOGGLE_DASHBOARD", EV_COMMON_TOGGLE_DASHBOARD, "Keyboard EXPL+CTRL+U", _LC("InputEvent", "display or hide the dashboard overlay")},
94  {"COMMON_TOGGLE_DEBUG_VIEW", EV_COMMON_TOGGLE_DEBUG_VIEW, "Keyboard EXPL+K", _LC("InputEvent", "toggle debug view")},
95  {"COMMON_CYCLE_DEBUG_VIEWS", EV_COMMON_CYCLE_DEBUG_VIEWS, "Keyboard EXPL+CTRL+K", _LC("InputEvent", "cycle debug views")},
96  {"COMMON_TRUCK_INFO", EV_COMMON_TRUCK_INFO, "Keyboard EXPL+T", _LC("InputEvent", "toggle truck HUD")},
97  {"COMMON_TRUCK_DESCRIPTION", EV_COMMON_TRUCK_DESCRIPTION, "Keyboard EXPL+CTRL+T", _LC("InputEvent", "toggle truck description")},
98  {"COMMON_NETCHATDISPLAY", EV_COMMON_NETCHATDISPLAY, "Keyboard EXPL+SHIFT+U", _LC("InputEvent", "display or hide net chat")},
99  {"COMMON_NETCHATMODE", EV_COMMON_NETCHATMODE, "Keyboard EXPL+CTRL+U", _LC("InputEvent", "toggle between net chat display modes")},
100  {"COMMON_TOGGLE_STATS", EV_COMMON_TOGGLE_STATS, "Keyboard EXPL+F", _LC("InputEvent", "toggle Ogre statistics (FPS etc.)")},
101 
102  // Common: savegames
103  {"COMMON_QUICKSAVE_01", EV_COMMON_QUICKSAVE_01, "Keyboard EXPL+ALT+CTRL+1", _LC("InputEvent", "save scene in slot 01")},
104  {"COMMON_QUICKSAVE_02", EV_COMMON_QUICKSAVE_02, "Keyboard EXPL+ALT+CTRL+2", _LC("InputEvent", "save scene in slot 02")},
105  {"COMMON_QUICKSAVE_03", EV_COMMON_QUICKSAVE_03, "Keyboard EXPL+ALT+CTRL+3", _LC("InputEvent", "save scene in slot 03")},
106  {"COMMON_QUICKSAVE_04", EV_COMMON_QUICKSAVE_04, "Keyboard EXPL+ALT+CTRL+4", _LC("InputEvent", "save scene in slot 04")},
107  {"COMMON_QUICKSAVE_05", EV_COMMON_QUICKSAVE_05, "Keyboard EXPL+ALT+CTRL+5", _LC("InputEvent", "save scene in slot 05")},
108  {"COMMON_QUICKSAVE_06", EV_COMMON_QUICKSAVE_06, "Keyboard EXPL+ALT+CTRL+6", _LC("InputEvent", "save scene in slot 06")},
109  {"COMMON_QUICKSAVE_07", EV_COMMON_QUICKSAVE_07, "Keyboard EXPL+ALT+CTRL+7", _LC("InputEvent", "save scene in slot 07")},
110  {"COMMON_QUICKSAVE_08", EV_COMMON_QUICKSAVE_08, "Keyboard EXPL+ALT+CTRL+8", _LC("InputEvent", "save scene in slot 08")},
111  {"COMMON_QUICKSAVE_09", EV_COMMON_QUICKSAVE_09, "Keyboard EXPL+ALT+CTRL+9", _LC("InputEvent", "save scene in slot 09")},
112  {"COMMON_QUICKSAVE_10", EV_COMMON_QUICKSAVE_10, "Keyboard EXPL+ALT+CTRL+0", _LC("InputEvent", "save scene in slot 10")},
113 
114  {"COMMON_QUICKLOAD_01", EV_COMMON_QUICKLOAD_01, "Keyboard EXPL+ALT+1", _LC("InputEvent", "load scene from slot 01")},
115  {"COMMON_QUICKLOAD_02", EV_COMMON_QUICKLOAD_02, "Keyboard EXPL+ALT+2", _LC("InputEvent", "load scene from slot 02")},
116  {"COMMON_QUICKLOAD_03", EV_COMMON_QUICKLOAD_03, "Keyboard EXPL+ALT+3", _LC("InputEvent", "load scene from slot 03")},
117  {"COMMON_QUICKLOAD_04", EV_COMMON_QUICKLOAD_04, "Keyboard EXPL+ALT+4", _LC("InputEvent", "load scene from slot 04")},
118  {"COMMON_QUICKLOAD_05", EV_COMMON_QUICKLOAD_05, "Keyboard EXPL+ALT+5", _LC("InputEvent", "load scene from slot 05")},
119  {"COMMON_QUICKLOAD_06", EV_COMMON_QUICKLOAD_06, "Keyboard EXPL+ALT+6", _LC("InputEvent", "load scene from slot 06")},
120  {"COMMON_QUICKLOAD_07", EV_COMMON_QUICKLOAD_07, "Keyboard EXPL+ALT+7", _LC("InputEvent", "load scene from slot 07")},
121  {"COMMON_QUICKLOAD_08", EV_COMMON_QUICKLOAD_08, "Keyboard EXPL+ALT+8", _LC("InputEvent", "load scene from slot 08")},
122  {"COMMON_QUICKLOAD_09", EV_COMMON_QUICKLOAD_09, "Keyboard EXPL+ALT+9", _LC("InputEvent", "load scene from slot 09")},
123  {"COMMON_QUICKLOAD_10", EV_COMMON_QUICKLOAD_10, "Keyboard EXPL+ALT+0", _LC("InputEvent", "load scene from slot 10")},
124 
125  // Truck: generic
126  {"TRUCK_ACCELERATE", EV_TRUCK_ACCELERATE, "Keyboard UP", _LC("InputEvent", "accelerate the truck")},
127  {"TRUCK_ACCELERATE_MODIFIER_25", EV_TRUCK_ACCELERATE_MODIFIER_25, "Keyboard ALT+UP", _LC("InputEvent", "accelerate with 25 percent pedal input")},
128  {"TRUCK_ACCELERATE_MODIFIER_50", EV_TRUCK_ACCELERATE_MODIFIER_50, "Keyboard CTRL+UP", _LC("InputEvent", "accelerate with 50 percent pedal input")},
129  {"TRUCK_BLINK_LEFT", EV_TRUCK_BLINK_LEFT, "Keyboard EXPL+COMMA", _LC("InputEvent", "toggle left direction indicator (blinker)")},
130  {"TRUCK_BLINK_RIGHT", EV_TRUCK_BLINK_RIGHT, "Keyboard EXPL+PERIOD", _LC("InputEvent", "toggle right direction indicator (blinker)")},
131  {"TRUCK_BLINK_WARN", EV_TRUCK_BLINK_WARN, "Keyboard EXPL+MINUS", _LC("InputEvent", "toggle all direction indicators")},
132  {"TRUCK_BRAKE", EV_TRUCK_BRAKE, "Keyboard DOWN", _LC("InputEvent", "brake")},
133  {"TRUCK_BRAKE_MODIFIER_25", EV_TRUCK_BRAKE_MODIFIER_25, "Keyboard ALT+DOWN", _LC("InputEvent", "brake with 25 percent pedal input")},
134  {"TRUCK_BRAKE_MODIFIER_50", EV_TRUCK_BRAKE_MODIFIER_50, "Keyboard CTRL+DOWN", _LC("InputEvent", "brake with 50 percent pedal input")},
135  {"TRUCK_HORN", EV_TRUCK_HORN, "Keyboard H", _LC("InputEvent", "truck horn")},
136  {"TRUCK_LIGHTTOGGLE1", EV_TRUCK_LIGHTTOGGLE01, "Keyboard EXPL+CTRL+1", _LC("InputEvent", "toggle custom light 1")},
137  {"TRUCK_LIGHTTOGGLE2", EV_TRUCK_LIGHTTOGGLE02, "Keyboard EXPL+CTRL+2", _LC("InputEvent", "toggle custom light 2")},
138  {"TRUCK_LIGHTTOGGLE3", EV_TRUCK_LIGHTTOGGLE03, "Keyboard EXPL+CTRL+3", _LC("InputEvent", "toggle custom light 3")},
139  {"TRUCK_LIGHTTOGGLE4", EV_TRUCK_LIGHTTOGGLE04, "Keyboard EXPL+CTRL+4", _LC("InputEvent", "toggle custom light 4")},
140  {"TRUCK_LIGHTTOGGLE5", EV_TRUCK_LIGHTTOGGLE05, "Keyboard EXPL+CTRL+5", _LC("InputEvent", "toggle custom light 5")},
141  {"TRUCK_LIGHTTOGGLE6", EV_TRUCK_LIGHTTOGGLE06, "Keyboard EXPL+CTRL+6", _LC("InputEvent", "toggle custom light 6")},
142  {"TRUCK_LIGHTTOGGLE7", EV_TRUCK_LIGHTTOGGLE07, "Keyboard EXPL+CTRL+7", _LC("InputEvent", "toggle custom light 7")},
143  {"TRUCK_LIGHTTOGGLE8", EV_TRUCK_LIGHTTOGGLE08, "Keyboard EXPL+CTRL+8", _LC("InputEvent", "toggle custom light 8")},
144  {"TRUCK_LIGHTTOGGLE9", EV_TRUCK_LIGHTTOGGLE09, "Keyboard EXPL+CTRL+9", _LC("InputEvent", "toggle custom light 9")},
145  {"TRUCK_LIGHTTOGGLE10", EV_TRUCK_LIGHTTOGGLE10, "Keyboard EXPL+CTRL+0", _LC("InputEvent", "toggle custom light 10")},
146  {"TRUCK_PARKING_BRAKE", EV_TRUCK_PARKING_BRAKE, "Keyboard P", _LC("InputEvent", "toggle parking brake")},
147  {"TRUCK_TRAILER_PARKING_BRAKE", EV_TRUCK_TRAILER_PARKING_BRAKE, "Keyboard EXPL+CTRL+P", _LC("InputEvent", "toggle trailer parking brake")},
148  {"TRUCK_ANTILOCK_BRAKE", EV_TRUCK_ANTILOCK_BRAKE, "Keyboard EXPL+SHIFT+B", _LC("InputEvent", "toggle antilock brake")},
149  {"TRUCK_TOGGLE_VIDEOCAMERA", EV_TRUCK_TOGGLE_VIDEOCAMERA, "Keyboard EXPL+CTRL+V", _LC("InputEvent", "toggle videocamera")},
150  {"TRUCK_TRACTION_CONTROL", EV_TRUCK_TRACTION_CONTROL, "Keyboard EXPL+SHIFT+T", _LC("InputEvent", "toggle traction control")},
151  {"TRUCK_CRUISE_CONTROL", EV_TRUCK_CRUISE_CONTROL, "Keyboard EXPL+SPACE", _LC("InputEvent", "toggle cruise control")},
152  {"TRUCK_CRUISE_CONTROL_READJUST", EV_TRUCK_CRUISE_CONTROL_READJUST, "Keyboard EXPL+CTRL+SPACE", _LC("InputEvent", "match target speed / rpm with current truck speed / rpm")},
153  {"TRUCK_CRUISE_CONTROL_ACCL", EV_TRUCK_CRUISE_CONTROL_ACCL, "Keyboard EXPL+CTRL+R", _LC("InputEvent", "increase target speed / rpm")},
154  {"TRUCK_CRUISE_CONTROL_DECL", EV_TRUCK_CRUISE_CONTROL_DECL, "Keyboard EXPL+CTRL+F", _LC("InputEvent", "decrease target speed / rpm")},
155  {"TRUCK_STARTER", EV_TRUCK_STARTER, "Keyboard S", _LC("InputEvent", "hold to start the engine")},
156  {"TRUCK_STEER_LEFT", EV_TRUCK_STEER_LEFT, "Keyboard LEFT", _LC("InputEvent", "steer left")},
157  {"TRUCK_STEER_RIGHT", EV_TRUCK_STEER_RIGHT, "Keyboard RIGHT", _LC("InputEvent", "steer right")},
158  {"TRUCK_TOGGLE_CONTACT", EV_TRUCK_TOGGLE_CONTACT, "Keyboard X", _LC("InputEvent", "toggle ignition")},
159  {"TRUCK_TOGGLE_FORWARDCOMMANDS", EV_TRUCK_TOGGLE_FORWARDCOMMANDS, "Keyboard EXPL+CTRL+SHIFT+F", _LC("InputEvent", "toggle forwardcommands")},
160  {"TRUCK_TOGGLE_IMPORTCOMMANDS", EV_TRUCK_TOGGLE_IMPORTCOMMANDS, "Keyboard EXPL+CTRL+SHIFT+I", _LC("InputEvent", "toggle importcommands")},
161  {"TRUCK_TOGGLE_PHYSICS", EV_TRUCK_TOGGLE_PHYSICS, "Keyboard END", _LC("InputEvent", "toggle physics")},
162  {"TRUCK_TOGGLE_INTER_AXLE_DIFF", EV_TRUCK_TOGGLE_INTER_AXLE_DIFF, "Keyboard EXPL+ALT+W", _LC("InputEvent", "cycle between available inter axle differential modes")},
163  {"TRUCK_TOGGLE_INTER_WHEEL_DIFF", EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF, "Keyboard EXPL+W", _LC("InputEvent", "cycle between available inter wheel differential modes")},
164  {"TRUCK_TOGGLE_TCASE_4WD_MODE", EV_TRUCK_TOGGLE_TCASE_4WD_MODE, "Keyboard EXPL+CTRL+W", _LC("InputEvent", "toggle transfer case mode")},
165  {"TRUCK_TOGGLE_TCASE_GEAR_RATIO", EV_TRUCK_TOGGLE_TCASE_GEAR_RATIO, "Keyboard EXPL+SHIFT+W", _LC("InputEvent", "toggle transfer case gear ratio")},
166  {"TRUCK_LEFT_MIRROR_LEFT", EV_TRUCK_LEFT_MIRROR_LEFT, "Keyboard EXPL+SEMICOLON", _LC("InputEvent", "move left mirror to the left")},
167  {"TRUCK_LEFT_MIRROR_RIGHT", EV_TRUCK_LEFT_MIRROR_RIGHT, "Keyboard EXPL+CTRL+SEMICOLON", _LC("InputEvent", "move left mirror to the right")},
168  {"TRUCK_RIGHT_MIRROR_LEFT", EV_TRUCK_RIGHT_MIRROR_LEFT, "Keyboard EXPL+COLON", _LC("InputEvent", "more right mirror to the left")},
169  {"TRUCK_RIGHT_MIRROR_RIGHT", EV_TRUCK_RIGHT_MIRROR_RIGHT, "Keyboard EXPL+CTRL+COLON", _LC("InputEvent", "move right mirror to the right")},
170 
171  // Truck: transmission
172  {"TRUCK_AUTOSHIFT_DOWN", EV_TRUCK_AUTOSHIFT_DOWN, "Keyboard PGDOWN", _LC("InputEvent", "shift automatic transmission one gear down")},
173  {"TRUCK_AUTOSHIFT_UP", EV_TRUCK_AUTOSHIFT_UP, "Keyboard PGUP", _LC("InputEvent", "shift automatic transmission one gear up")},
174  {"TRUCK_MANUAL_CLUTCH", EV_TRUCK_MANUAL_CLUTCH, "Keyboard LSHIFT", _LC("InputEvent", "manual clutch (for manual transmission)")},
175  {"TRUCK_SHIFT_DOWN", EV_TRUCK_SHIFT_DOWN, "Keyboard Z", _LC("InputEvent", "shift one gear down in manual transmission mode")},
176  {"TRUCK_SHIFT_NEUTRAL", EV_TRUCK_SHIFT_NEUTRAL, "Keyboard D", _LC("InputEvent", "shift to neutral gear in manual transmission mode")},
177  {"TRUCK_SHIFT_UP", EV_TRUCK_SHIFT_UP, "Keyboard A", _LC("InputEvent", "shift one gear up in manual transmission mode")},
178  {"TRUCK_SHIFT_GEAR_REVERSE", EV_TRUCK_SHIFT_GEAR_REVERSE, "", _LC("InputEvent", "shift directly to reverse gear")},
179  {"TRUCK_SHIFT_GEAR1", EV_TRUCK_SHIFT_GEAR01, "", _LC("InputEvent", "shift directly to first gear")},
180  {"TRUCK_SHIFT_GEAR2", EV_TRUCK_SHIFT_GEAR02, "", _LC("InputEvent", "shift directly to second gear")},
181  {"TRUCK_SHIFT_GEAR3", EV_TRUCK_SHIFT_GEAR03, "", _LC("InputEvent", "shift directly to third gear")},
182  {"TRUCK_SHIFT_GEAR4", EV_TRUCK_SHIFT_GEAR04, "", _LC("InputEvent", "shift directly to fourth gear")},
183  {"TRUCK_SHIFT_GEAR5", EV_TRUCK_SHIFT_GEAR05, "", _LC("InputEvent", "shift directly to 5th gear")},
184  {"TRUCK_SHIFT_GEAR6", EV_TRUCK_SHIFT_GEAR06, "", _LC("InputEvent", "shift directly to 6th gear")},
185  {"TRUCK_SHIFT_GEAR7", EV_TRUCK_SHIFT_GEAR07, "", _LC("InputEvent", "shift directly to 7th gear")},
186  {"TRUCK_SHIFT_GEAR8", EV_TRUCK_SHIFT_GEAR08, "", _LC("InputEvent", "shift directly to 8th gear")},
187  {"TRUCK_SHIFT_GEAR9", EV_TRUCK_SHIFT_GEAR09, "", _LC("InputEvent", "shift directly to 9th gear")},
188  {"TRUCK_SHIFT_GEAR10", EV_TRUCK_SHIFT_GEAR10, "", _LC("InputEvent", "shift directly to 10th gear")},
189  {"TRUCK_SHIFT_GEAR11", EV_TRUCK_SHIFT_GEAR11, "", _LC("InputEvent", "shift directly to 11th gear")},
190  {"TRUCK_SHIFT_GEAR12", EV_TRUCK_SHIFT_GEAR12, "", _LC("InputEvent", "shift directly to 12th gear")},
191  {"TRUCK_SHIFT_GEAR13", EV_TRUCK_SHIFT_GEAR13, "", _LC("InputEvent", "shift directly to 13th gear")},
192  {"TRUCK_SHIFT_GEAR14", EV_TRUCK_SHIFT_GEAR14, "", _LC("InputEvent", "shift directly to 14th gear")},
193  {"TRUCK_SHIFT_GEAR15", EV_TRUCK_SHIFT_GEAR15, "", _LC("InputEvent", "shift directly to 15th gear")},
194  {"TRUCK_SHIFT_GEAR16", EV_TRUCK_SHIFT_GEAR16, "", _LC("InputEvent", "shift directly to 16th gear")},
195  {"TRUCK_SHIFT_GEAR17", EV_TRUCK_SHIFT_GEAR17, "", _LC("InputEvent", "shift directly to 17th gear")},
196  {"TRUCK_SHIFT_GEAR18", EV_TRUCK_SHIFT_GEAR18, "", _LC("InputEvent", "shift directly to 18th gear")},
197  {"TRUCK_SHIFT_LOWRANGE", EV_TRUCK_SHIFT_LOWRANGE, "", _LC("InputEvent", "sets low range (1-6) for H-shaft")},
198  {"TRUCK_SHIFT_MIDRANGE", EV_TRUCK_SHIFT_MIDRANGE, "", _LC("InputEvent", "sets middle range (7-12) for H-shaft")},
199  {"TRUCK_SHIFT_HIGHRANGE", EV_TRUCK_SHIFT_HIGHRANGE, "", _LC("InputEvent", "sets high range (13-18) for H-shaft")},
200  {"TRUCK_SWITCH_SHIFT_MODES", EV_TRUCK_SWITCH_SHIFT_MODES, "Keyboard Q", _LC("InputEvent", "toggle between transmission modes")},
201 
202  // Airplane
203  {"AIRPLANE_STEER_RIGHT", EV_AIRPLANE_STEER_RIGHT, "Keyboard RIGHT", _LC("InputEvent", "steer right")},
204  {"AIRPLANE_BRAKE", EV_AIRPLANE_BRAKE, "Keyboard B", _LC("InputEvent", "normal brake for an aircraft")},
205  {"AIRPLANE_ELEVATOR_DOWN", EV_AIRPLANE_ELEVATOR_DOWN, "Keyboard DOWN", _LC("InputEvent", "pull the elevator down in an aircraft.")},
206  {"AIRPLANE_ELEVATOR_UP", EV_AIRPLANE_ELEVATOR_UP, "Keyboard UP", _LC("InputEvent", "pull the elevator up in an aircraft.")},
207  {"AIRPLANE_FLAPS_FULL", EV_AIRPLANE_FLAPS_FULL, "Keyboard CTRL+2", _LC("InputEvent", "full flaps in an aircraft.")},
208  {"AIRPLANE_FLAPS_LESS", EV_AIRPLANE_FLAPS_LESS, "Keyboard EXPL+1", _LC("InputEvent", "one step less flaps.")},
209  {"AIRPLANE_FLAPS_MORE", EV_AIRPLANE_FLAPS_MORE, "Keyboard EXPL+2", _LC("InputEvent", "one step more flaps.")},
210  {"AIRPLANE_FLAPS_NONE", EV_AIRPLANE_FLAPS_NONE, "Keyboard CTRL+1", _LC("InputEvent", "no flaps.")},
211  {"AIRPLANE_PARKING_BRAKE", EV_AIRPLANE_PARKING_BRAKE, "Keyboard P", _LC("InputEvent", "airplane parking brake.")},
212  {"AIRPLANE_REVERSE", EV_AIRPLANE_REVERSE, "Keyboard R", _LC("InputEvent", "reverse the turboprops")},
213  {"AIRPLANE_RUDDER_LEFT", EV_AIRPLANE_RUDDER_LEFT, "Keyboard Z", _LC("InputEvent", "rudder left")},
214  {"AIRPLANE_RUDDER_RIGHT", EV_AIRPLANE_RUDDER_RIGHT, "Keyboard X", _LC("InputEvent", "rudder right")},
215  {"AIRPLANE_STEER_LEFT", EV_AIRPLANE_STEER_LEFT, "Keyboard LEFT", _LC("InputEvent", "steer left")},
216  {"AIRPLANE_STEER_RIGHT", EV_AIRPLANE_STEER_RIGHT, "Keyboard RIGHT", _LC("InputEvent", "steer right")},
217  {"AIRPLANE_THROTTLE_AXIS", EV_AIRPLANE_THROTTLE_AXIS, "None", _LC("InputEvent", "throttle axis. Only use this if you have fitting hardware :) (i.e. a Slider)")},
218  {"AIRPLANE_THROTTLE_DOWN", EV_AIRPLANE_THROTTLE_DOWN, "Keyboard EXPL+PGDOWN", _LC("InputEvent", "decreases the airplane thrust")},
219  {"AIRPLANE_THROTTLE_FULL", EV_AIRPLANE_THROTTLE_FULL, "Keyboard CTRL+PGUP", _LC("InputEvent", "full thrust")},
220  {"AIRPLANE_THROTTLE_NO", EV_AIRPLANE_THROTTLE_NO, "Keyboard CTRL+PGDOWN", _LC("InputEvent", "no thrust")},
221  {"AIRPLANE_THROTTLE_UP", EV_AIRPLANE_THROTTLE_UP, "Keyboard EXPL+PGUP", _LC("InputEvent", "increase the airplane thrust")},
222  {"AIRPLANE_TOGGLE_ENGINES", EV_AIRPLANE_TOGGLE_ENGINES, "Keyboard CTRL+HOME", _LC("InputEvent", "switch all engines on / off")},
223  {"AIRPLANE_AIRBRAKES_NONE", EV_AIRPLANE_AIRBRAKES_NONE, "Keyboard CTRL+3", _LC("InputEvent", "no airbrakes")},
224  {"AIRPLANE_AIRBRAKES_FULL", EV_AIRPLANE_AIRBRAKES_FULL, "Keyboard CTRL+4", _LC("InputEvent", "full airbrakes")},
225  {"AIRPLANE_AIRBRAKES_LESS", EV_AIRPLANE_AIRBRAKES_LESS, "Keyboard EXPL+3", _LC("InputEvent", "less airbrakes")},
226  {"AIRPLANE_AIRBRAKES_MORE", EV_AIRPLANE_AIRBRAKES_MORE, "Keyboard EXPL+4", _LC("InputEvent", "more airbrakes")},
227  {"AIRPLANE_THROTTLE", EV_AIRPLANE_THROTTLE, "", _LC("InputEvent", "airplane throttle")},
228 
229  // Boat
230  {"BOAT_CENTER_RUDDER", EV_BOAT_CENTER_RUDDER, "Keyboard PGDOWN", _LC("InputEvent", "center the rudder")},
231  {"BOAT_REVERSE", EV_BOAT_REVERSE, "Keyboard PGUP", _LC("InputEvent", "no thrust")},
232  {"BOAT_STEER_LEFT", EV_BOAT_STEER_LEFT, "Keyboard LEFT", _LC("InputEvent", "steer left a step")},
233  {"BOAT_STEER_LEFT_AXIS", EV_BOAT_STEER_LEFT_AXIS, "None", _LC("InputEvent", "steer left (analog value!)")},
234  {"BOAT_STEER_RIGHT", EV_BOAT_STEER_RIGHT, "Keyboard RIGHT", _LC("InputEvent", "steer right a step")},
235  {"BOAT_STEER_RIGHT_AXIS", EV_BOAT_STEER_RIGHT_AXIS, "None", _LC("InputEvent", "steer right (analog value!)")},
236  {"BOAT_THROTTLE_AXIS", EV_BOAT_THROTTLE_AXIS, "None", _LC("InputEvent", "throttle axis. Only use this if you have fitting hardware :) (i.e. a Slider)")},
237  {"BOAT_THROTTLE_DOWN", EV_BOAT_THROTTLE_DOWN, "Keyboard DOWN", _LC("InputEvent", "decrease throttle")},
238  {"BOAT_THROTTLE_UP", EV_BOAT_THROTTLE_UP, "Keyboard UP", _LC("InputEvent", "increase throttle")},
239 
240  // Commands
241  {"COMMANDS_01", EV_COMMANDS_01, "Keyboard EXPL+F1", _LC("InputEvent", "Command 1")},
242  {"COMMANDS_02", EV_COMMANDS_02, "Keyboard EXPL+F2", _LC("InputEvent", "Command 2")},
243  {"COMMANDS_03", EV_COMMANDS_03, "Keyboard EXPL+F3", _LC("InputEvent", "Command 3")},
244  {"COMMANDS_04", EV_COMMANDS_04, "Keyboard EXPL+F4", _LC("InputEvent", "Command 4")},
245  {"COMMANDS_05", EV_COMMANDS_05, "Keyboard EXPL+F5", _LC("InputEvent", "Command 5")},
246  {"COMMANDS_06", EV_COMMANDS_06, "Keyboard EXPL+F6", _LC("InputEvent", "Command 6")},
247  {"COMMANDS_07", EV_COMMANDS_07, "Keyboard EXPL+F7", _LC("InputEvent", "Command 7")},
248  {"COMMANDS_08", EV_COMMANDS_08, "Keyboard EXPL+F8", _LC("InputEvent", "Command 8")},
249  {"COMMANDS_09", EV_COMMANDS_09, "Keyboard EXPL+F9", _LC("InputEvent", "Command 9")},
250  {"COMMANDS_10", EV_COMMANDS_10, "Keyboard EXPL+F10", _LC("InputEvent", "Command 10")},
251  {"COMMANDS_11", EV_COMMANDS_11, "Keyboard EXPL+F11", _LC("InputEvent", "Command 11")},
252  {"COMMANDS_12", EV_COMMANDS_12, "Keyboard EXPL+F12", _LC("InputEvent", "Command 12")},
253  {"COMMANDS_13", EV_COMMANDS_13, "Keyboard EXPL+CTRL+F1", _LC("InputEvent", "Command 13")},
254  {"COMMANDS_14", EV_COMMANDS_14, "Keyboard EXPL+CTRL+F2", _LC("InputEvent", "Command 14")},
255  {"COMMANDS_15", EV_COMMANDS_15, "Keyboard EXPL+CTRL+F3", _LC("InputEvent", "Command 15")},
256  {"COMMANDS_16", EV_COMMANDS_16, "Keyboard EXPL+CTRL+F4", _LC("InputEvent", "Command 16")},
257  {"COMMANDS_17", EV_COMMANDS_17, "Keyboard EXPL+CTRL+F5", _LC("InputEvent", "Command 17")},
258  {"COMMANDS_18", EV_COMMANDS_18, "Keyboard EXPL+CTRL+F6", _LC("InputEvent", "Command 18")},
259  {"COMMANDS_19", EV_COMMANDS_19, "Keyboard EXPL+CTRL+F7", _LC("InputEvent", "Command 19")},
260  {"COMMANDS_20", EV_COMMANDS_20, "Keyboard EXPL+CTRL+F8", _LC("InputEvent", "Command 20")},
261  {"COMMANDS_21", EV_COMMANDS_21, "Keyboard EXPL+CTRL+F9", _LC("InputEvent", "Command 21")},
262  {"COMMANDS_22", EV_COMMANDS_22, "Keyboard EXPL+CTRL+F10", _LC("InputEvent", "Command 22")},
263  {"COMMANDS_23", EV_COMMANDS_23, "Keyboard EXPL+CTRL+F11", _LC("InputEvent", "Command 23")},
264  {"COMMANDS_24", EV_COMMANDS_24, "Keyboard EXPL+CTRL+F12", _LC("InputEvent", "Command 24")},
265  {"COMMANDS_25", EV_COMMANDS_25, "Keyboard EXPL+SHIFT+F1", _LC("InputEvent", "Command 25")},
266  {"COMMANDS_26", EV_COMMANDS_26, "Keyboard EXPL+SHIFT+F2", _LC("InputEvent", "Command 26")},
267  {"COMMANDS_27", EV_COMMANDS_27, "Keyboard EXPL+SHIFT+F3", _LC("InputEvent", "Command 27")},
268  {"COMMANDS_28", EV_COMMANDS_28, "Keyboard EXPL+SHIFT+F4", _LC("InputEvent", "Command 28")},
269  {"COMMANDS_29", EV_COMMANDS_29, "Keyboard EXPL+SHIFT+F5", _LC("InputEvent", "Command 29")},
270  {"COMMANDS_30", EV_COMMANDS_30, "Keyboard EXPL+SHIFT+F6", _LC("InputEvent", "Command 30")},
271  {"COMMANDS_31", EV_COMMANDS_31, "Keyboard EXPL+SHIFT+F7", _LC("InputEvent", "Command 31")},
272  {"COMMANDS_32", EV_COMMANDS_32, "Keyboard EXPL+SHIFT+F8", _LC("InputEvent", "Command 32")},
273  {"COMMANDS_33", EV_COMMANDS_33, "Keyboard EXPL+SHIFT+F9", _LC("InputEvent", "Command 33")},
274  {"COMMANDS_34", EV_COMMANDS_34, "Keyboard EXPL+SHIFT+F10", _LC("InputEvent", "Command 34")},
275  {"COMMANDS_35", EV_COMMANDS_35, "Keyboard EXPL+SHIFT+F11", _LC("InputEvent", "Command 35")},
276  {"COMMANDS_36", EV_COMMANDS_36, "Keyboard EXPL+SHIFT+F12", _LC("InputEvent", "Command 36")},
277  {"COMMANDS_37", EV_COMMANDS_37, "Keyboard EXPL+ALT+F1", _LC("InputEvent", "Command 37")},
278  {"COMMANDS_38", EV_COMMANDS_38, "Keyboard EXPL+ALT+F2", _LC("InputEvent", "Command 38")},
279  {"COMMANDS_39", EV_COMMANDS_39, "Keyboard EXPL+ALT+F3", _LC("InputEvent", "Command 39")},
280  {"COMMANDS_40", EV_COMMANDS_40, "Keyboard EXPL+ALT+F4", _LC("InputEvent", "Command 40")},
281  {"COMMANDS_41", EV_COMMANDS_41, "Keyboard EXPL+ALT+F5", _LC("InputEvent", "Command 41")},
282  {"COMMANDS_42", EV_COMMANDS_42, "Keyboard EXPL+ALT+F6", _LC("InputEvent", "Command 42")},
283  {"COMMANDS_43", EV_COMMANDS_43, "Keyboard EXPL+ALT+F7", _LC("InputEvent", "Command 43")},
284  {"COMMANDS_44", EV_COMMANDS_44, "Keyboard EXPL+ALT+F8", _LC("InputEvent", "Command 44")},
285  {"COMMANDS_45", EV_COMMANDS_45, "Keyboard EXPL+ALT+F9", _LC("InputEvent", "Command 45")},
286  {"COMMANDS_46", EV_COMMANDS_46, "Keyboard EXPL+ALT+F10", _LC("InputEvent", "Command 46")},
287  {"COMMANDS_47", EV_COMMANDS_47, "Keyboard EXPL+ALT+F11", _LC("InputEvent", "Command 47")},
288  {"COMMANDS_48", EV_COMMANDS_48, "Keyboard EXPL+ALT+F12", _LC("InputEvent", "Command 48")},
289  {"COMMANDS_49", EV_COMMANDS_49, "Keyboard EXPL+CTRL+SHIFT+F1", _LC("InputEvent", "Command 49")},
290  {"COMMANDS_50", EV_COMMANDS_50, "Keyboard EXPL+CTRL+SHIFT+F2", _LC("InputEvent", "Command 50")},
291  {"COMMANDS_51", EV_COMMANDS_51, "Keyboard EXPL+CTRL+SHIFT+F3", _LC("InputEvent", "Command 51")},
292  {"COMMANDS_52", EV_COMMANDS_52, "Keyboard EXPL+CTRL+SHIFT+F4", _LC("InputEvent", "Command 52")},
293  {"COMMANDS_53", EV_COMMANDS_53, "Keyboard EXPL+CTRL+SHIFT+F5", _LC("InputEvent", "Command 53")},
294  {"COMMANDS_54", EV_COMMANDS_54, "Keyboard EXPL+CTRL+SHIFT+F6", _LC("InputEvent", "Command 54")},
295  {"COMMANDS_55", EV_COMMANDS_55, "Keyboard EXPL+CTRL+SHIFT+F7", _LC("InputEvent", "Command 55")},
296  {"COMMANDS_56", EV_COMMANDS_56, "Keyboard EXPL+CTRL+SHIFT+F8", _LC("InputEvent", "Command 56")},
297  {"COMMANDS_57", EV_COMMANDS_57, "Keyboard EXPL+CTRL+SHIFT+F9", _LC("InputEvent", "Command 57")},
298  {"COMMANDS_58", EV_COMMANDS_58, "Keyboard EXPL+CTRL+SHIFT+F10", _LC("InputEvent", "Command 58")},
299  {"COMMANDS_59", EV_COMMANDS_59, "Keyboard EXPL+CTRL+SHIFT+F11", _LC("InputEvent", "Command 59")},
300  {"COMMANDS_60", EV_COMMANDS_60, "Keyboard EXPL+CTRL+SHIFT+F12", _LC("InputEvent", "Command 60")},
301  {"COMMANDS_61", EV_COMMANDS_61, "Keyboard EXPL+CTRL+ALT+F1", _LC("InputEvent", "Command 61")},
302  {"COMMANDS_62", EV_COMMANDS_62, "Keyboard EXPL+CTRL+ALT+F2", _LC("InputEvent", "Command 62")},
303  {"COMMANDS_63", EV_COMMANDS_63, "Keyboard EXPL+CTRL+ALT+F3", _LC("InputEvent", "Command 63")},
304  {"COMMANDS_64", EV_COMMANDS_64, "Keyboard EXPL+CTRL+ALT+F4", _LC("InputEvent", "Command 64")},
305  {"COMMANDS_65", EV_COMMANDS_65, "Keyboard EXPL+CTRL+ALT+F5", _LC("InputEvent", "Command 65")},
306  {"COMMANDS_66", EV_COMMANDS_66, "Keyboard EXPL+CTRL+ALT+F6", _LC("InputEvent", "Command 66")},
307  {"COMMANDS_67", EV_COMMANDS_67, "Keyboard EXPL+CTRL+ALT+F7", _LC("InputEvent", "Command 67")},
308  {"COMMANDS_68", EV_COMMANDS_68, "Keyboard EXPL+CTRL+ALT+F8", _LC("InputEvent", "Command 68")},
309  {"COMMANDS_69", EV_COMMANDS_69, "Keyboard EXPL+CTRL+ALT+F9", _LC("InputEvent", "Command 69")},
310  {"COMMANDS_70", EV_COMMANDS_70, "Keyboard EXPL+CTRL+ALT+F10", _LC("InputEvent", "Command 70")},
311  {"COMMANDS_71", EV_COMMANDS_71, "Keyboard EXPL+CTRL+ALT+F11", _LC("InputEvent", "Command 71")},
312  {"COMMANDS_72", EV_COMMANDS_72, "Keyboard EXPL+CTRL+ALT+F12", _LC("InputEvent", "Command 72")},
313  {"COMMANDS_73", EV_COMMANDS_73, "Keyboard EXPL+CTRL+SHIFT+ALT+F1",_LC("InputEvent", "Command 73")},
314  {"COMMANDS_74", EV_COMMANDS_74, "Keyboard EXPL+CTRL+SHIFT+ALT+F2",_LC("InputEvent", "Command 74")},
315  {"COMMANDS_75", EV_COMMANDS_75, "Keyboard EXPL+CTRL+SHIFT+ALT+F3",_LC("InputEvent", "Command 75")},
316  {"COMMANDS_76", EV_COMMANDS_76, "Keyboard EXPL+CTRL+SHIFT+ALT+F4",_LC("InputEvent", "Command 76")},
317  {"COMMANDS_77", EV_COMMANDS_77, "Keyboard EXPL+CTRL+SHIFT+ALT+F5",_LC("InputEvent", "Command 77")},
318  {"COMMANDS_78", EV_COMMANDS_78, "Keyboard EXPL+CTRL+SHIFT+ALT+F6",_LC("InputEvent", "Command 78")},
319  {"COMMANDS_79", EV_COMMANDS_79, "Keyboard EXPL+CTRL+SHIFT+ALT+F7",_LC("InputEvent", "Command 79")},
320  {"COMMANDS_80", EV_COMMANDS_80, "Keyboard EXPL+CTRL+SHIFT+ALT+F8",_LC("InputEvent", "Command 80")},
321  {"COMMANDS_81", EV_COMMANDS_81, "Keyboard EXPL+CTRL+SHIFT+ALT+F9",_LC("InputEvent", "Command 81")},
322  {"COMMANDS_82", EV_COMMANDS_82, "Keyboard EXPL+CTRL+SHIFT+ALT+F10",_LC("InputEvent", "Command 82")},
323  {"COMMANDS_83", EV_COMMANDS_83, "Keyboard EXPL+CTRL+SHIFT+ALT+F11",_LC("InputEvent", "Command 83")},
324  {"COMMANDS_84", EV_COMMANDS_84, "Keyboard EXPL+CTRL+SHIFT+ALT+F12",_LC("InputEvent", "Command 84")},
325 
326  // Character
327  {"CHARACTER_BACKWARDS", EV_CHARACTER_BACKWARDS, "Keyboard S", _LC("InputEvent", "step backwards with the character")},
328  {"CHARACTER_FORWARD", EV_CHARACTER_FORWARD, "Keyboard W", _LC("InputEvent", "step forward with the character")},
329  {"CHARACTER_JUMP", EV_CHARACTER_JUMP, "Keyboard SPACE", _LC("InputEvent", "let the character jump")},
330  {"CHARACTER_LEFT", EV_CHARACTER_LEFT, "Keyboard LEFT", _LC("InputEvent", "rotate character left")},
331  {"CHARACTER_RIGHT", EV_CHARACTER_RIGHT, "Keyboard RIGHT", _LC("InputEvent", "rotate character right")},
332  {"CHARACTER_RUN", EV_CHARACTER_RUN, "Keyboard SHIFT+W", _LC("InputEvent", "let the character run")},
333  {"CHARACTER_SIDESTEP_LEFT", EV_CHARACTER_SIDESTEP_LEFT, "Keyboard A", _LC("InputEvent", "sidestep to the left")},
334  {"CHARACTER_SIDESTEP_RIGHT", EV_CHARACTER_SIDESTEP_RIGHT, "Keyboard D", _LC("InputEvent", "sidestep to the right")},
335  {"CHARACTER_ROT_UP", EV_CHARACTER_ROT_UP, "Keyboard UP", _LC("InputEvent", "rotate view up")},
336  {"CHARACTER_ROT_DOWN", EV_CHARACTER_ROT_DOWN, "Keyboard DOWN", _LC("InputEvent", "rotate view down")},
337 
338  // Camera
339  {"CAMERA_CHANGE", EV_CAMERA_CHANGE, "Keyboard EXPL+C", _LC("InputEvent", "change camera mode")},
340  {"CAMERA_LOOKBACK", EV_CAMERA_LOOKBACK, "Keyboard NUMPAD1", _LC("InputEvent", "look back (toggles between normal and lookback)")},
341  {"CAMERA_RESET", EV_CAMERA_RESET, "Keyboard NUMPAD5", _LC("InputEvent", "reset the camera position")},
342  {"CAMERA_ROTATE_DOWN", EV_CAMERA_ROTATE_DOWN, "Keyboard NUMPAD2", _LC("InputEvent", "rotate camera down")},
343  {"CAMERA_ROTATE_LEFT", EV_CAMERA_ROTATE_LEFT, "Keyboard NUMPAD4", _LC("InputEvent", "rotate camera left")},
344  {"CAMERA_ROTATE_RIGHT", EV_CAMERA_ROTATE_RIGHT, "Keyboard NUMPAD6", _LC("InputEvent", "rotate camera right")},
345  {"CAMERA_ROTATE_UP", EV_CAMERA_ROTATE_UP, "Keyboard NUMPAD8", _LC("InputEvent", "rotate camera up")},
346  {"CAMERA_ZOOM_IN", EV_CAMERA_ZOOM_IN, "Keyboard EXPL+NUMPAD9", _LC("InputEvent", "zoom camera in")},
347  {"CAMERA_ZOOM_IN_FAST", EV_CAMERA_ZOOM_IN_FAST, "Keyboard SHIFT+NUMPAD9", _LC("InputEvent", "zoom camera in faster")},
348  {"CAMERA_ZOOM_OUT", EV_CAMERA_ZOOM_OUT, "Keyboard EXPL+NUMPAD3", _LC("InputEvent", "zoom camera out")},
349  {"CAMERA_ZOOM_OUT_FAST", EV_CAMERA_ZOOM_OUT_FAST, "Keyboard SHIFT+NUMPAD3", _LC("InputEvent", "zoom camera out faster")},
350  {"CAMERA_FREE_MODE_FIX", EV_CAMERA_FREE_MODE_FIX, "Keyboard EXPL+ALT+C", _LC("InputEvent", "fix the camera to a position")},
351  {"CAMERA_FREE_MODE", EV_CAMERA_FREE_MODE, "Keyboard EXPL+SHIFT+C", _LC("InputEvent", "enable / disable free camera mode")},
352  {"CAMERA_UP", EV_CAMERA_UP, "Keyboard Q", _LC("InputEvent", "move camera up")},
353  {"CAMERA_DOWN", EV_CAMERA_DOWN, "Keyboard Z", _LC("InputEvent", "move camera down")},
354 
355  // Sky
356  {"SKY_DECREASE_TIME", EV_SKY_DECREASE_TIME, "Keyboard EXPL+SUBTRACT", _LC("InputEvent", "decrease day-time")},
357  {"SKY_DECREASE_TIME_FAST", EV_SKY_DECREASE_TIME_FAST, "Keyboard SHIFT+SUBTRACT", _LC("InputEvent", "decrease day-time a lot faster")},
358  {"SKY_INCREASE_TIME", EV_SKY_INCREASE_TIME, "Keyboard EXPL+ADD", _LC("InputEvent", "increase day-time")},
359  {"SKY_INCREASE_TIME_FAST", EV_SKY_INCREASE_TIME_FAST, "Keyboard SHIFT+ADD", _LC("InputEvent", "increase day-time a lot faster")},
360 
361  // Grass
362  {"GRASS_LESS", EV_GRASS_LESS, "", _LC("InputEvent", "EXPERIMENTAL: remove some grass")},
363  {"GRASS_MORE", EV_GRASS_MORE, "", _LC("InputEvent", "EXPERIMENTAL: add some grass")},
364  {"GRASS_MOST", EV_GRASS_MOST, "", _LC("InputEvent", "EXPERIMENTAL: set maximum amount of grass")},
365  {"GRASS_NONE", EV_GRASS_NONE, "", _LC("InputEvent", "EXPERIMENTAL: remove grass completely")},
366  {"GRASS_SAVE", EV_GRASS_SAVE, "", _LC("InputEvent", "EXPERIMENTAL: save changes to the grass density image")},
367 
368  // Survey map
369  {"SURVEY_MAP_TOGGLE_ICONS", EV_SURVEY_MAP_TOGGLE_ICONS, "Keyboard EXPL+CTRL+SHIFT+ALT+TAB",_LC("InputEvent", "toggle map icons")},
370  {"SURVEY_MAP_TOGGLE", EV_SURVEY_MAP_TOGGLE, "Keyboard EXPL+CTRL+SHIFT+TAB", _LC("InputEvent", "toggle map")},
371  {"SURVEY_MAP_CYCLE", EV_SURVEY_MAP_CYCLE, "Keyboard EXPL+TAB", _LC("InputEvent", "cycle map modes")},
372  {"SURVEY_MAP_ZOOM_IN", EV_SURVEY_MAP_ZOOM_IN, "Keyboard EXPL+CTRL+TAB", _LC("InputEvent", "zoom in")},
373  {"SURVEY_MAP_ZOOM_OUT", EV_SURVEY_MAP_ZOOM_OUT, "Keyboard EXPL+SHIFT+TAB", _LC("InputEvent", "zoom out")},
374 
375  // Menu
376  {"MENU_DOWN", EV_MENU_DOWN, "Keyboard DOWN", _LC("InputEvent", "select next element in current category")},
377  {"MENU_LEFT", EV_MENU_LEFT, "Keyboard LEFT", _LC("InputEvent", "select previous category")},
378  {"MENU_RIGHT", EV_MENU_RIGHT, "Keyboard RIGHT", _LC("InputEvent", "select next category")},
379  {"MENU_SELECT", EV_MENU_SELECT, "Keyboard EXPL+RETURN", _LC("InputEvent", "select focussed item and close menu")},
380  {"MENU_UP", EV_MENU_UP, "Keyboard UP", _LC("InputEvent", "select previous element in current category")},
381 
382  // Truck editing
383  {"TRUCKEDIT_RELOAD", EV_TRUCKEDIT_RELOAD, "Keyboard EXPL+SHIFT+CTRL+R", _LC("InputEvent", "reload truck")},
384 
385  // Road editing
386  {"ROAD_EDITOR_POINT_INSERT", EV_ROAD_EDITOR_POINT_INSERT, "Keyboard EXPL+INSERT", _LC("InputEvent", "insert road point") },
387  {"ROAD_EDITOR_POINT_GOTO", EV_ROAD_EDITOR_POINT_GOTO, "Keyboard EXPL+G", _LC("InputEvent", "go to road point") },
388  {"ROAD_EDITOR_POINT_SET_POS", EV_ROAD_EDITOR_POINT_SET_POS, "Keyboard EXPL+M", _LC("InputEvent", "set road point position") },
389  {"ROAD_EDITOR_POINT_DELETE", EV_ROAD_EDITOR_POINT_DELETE, "Keyboard EXPL+DELETE", _LC("InputEvent", "delete road point") },
390  {"ROAD_EDITOR_REBUILD_MESH", EV_ROAD_EDITOR_REBUILD_MESH, "Keyboard EXPL+B", _LC("InputEvent", "regenerate road mesh") },
391 
392  // The end, DO NOT MODIFY
393  {"", -1, "", ""},
394 };
395 
396 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
397 #define strnlen(str,len) strlen(str)
398 #endif
399 
400 //Use this define to signify OIS will be used as a DLL
401 //(so that dll import/export macros are in effect)
402 #define OIS_DYNAMIC_LIB
403 #include <OIS.h>
404 
405 #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
406 #include <X11/Xlib.h>
407 //#include <linux/LinuxMouse.h>
408 #endif
409 
410 using namespace std;
411 using namespace Ogre;
412 using namespace OIS;
413 
414 const std::string InputEngine::DEFAULT_MAPFILE = "input.map";
415 
417  free_joysticks(0)
418  , mForceFeedback(0)
419  , mInputManager(0)
420  , mKeyboard(0)
421  , mMouse(0)
422  , uniqueCounter(0)
423 {
424  for (int i = 0; i < MAX_JOYSTICKS; i++)
425  mJoy[i] = 0;
426 
427  LOG("*** Loading OIS ***");
428 
429  initAllKeys();
430  setup();
431  windowResized(App::GetAppContext()->GetRenderWindow());
432 }
433 
435 {
436  destroy();
437 }
438 
440 {
441  if (mInputManager)
442  {
443  LOG("*** Terminating OIS ***");
444  if (mMouse)
445  {
446  mInputManager->destroyInputObject(mMouse);
447  mMouse = 0;
448  }
449  if (mKeyboard)
450  {
451  mInputManager->destroyInputObject(mKeyboard);
452  mKeyboard = 0;
453  }
454  if (mJoy)
455  {
456  for (int i = 0; i < MAX_JOYSTICKS; i++)
457  {
458  if (!mJoy[i])
459  continue;
460  mInputManager->destroyInputObject(mJoy[i]);
461  mJoy[i] = 0;
462  }
463  }
464 
465  OIS::InputManager::destroyInputSystem(mInputManager);
466  mInputManager = 0;
467  }
468 }
469 
471 {
472  size_t hWnd = 0;
473  App::GetAppContext()->GetRenderWindow()->getCustomAttribute("WINDOW", &hWnd);
474 
475  LOG("*** Initializing OIS ***");
476 
477  //try to delete old ones first (linux can only handle one at a time)
478  destroy();
479 
480  ParamList pl;
481  pl.insert(OIS::ParamList::value_type("WINDOW", TOSTRING(hWnd)));
482  if (App::io_input_grab_mode->getEnum<IoInputGrabMode>() != RoR::IoInputGrabMode::ALL)
483  {
484 #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
485  pl.insert(OIS::ParamList::value_type("x11_mouse_hide", "true"));
486  pl.insert(OIS::ParamList::value_type("XAutoRepeatOn", "false"));
487  pl.insert(OIS::ParamList::value_type("x11_mouse_grab", "false"));
488  pl.insert(OIS::ParamList::value_type("x11_keyboard_grab", "false"));
489 #else
490  pl.insert(OIS::ParamList::value_type("w32_mouse", "DISCL_FOREGROUND"));
491  pl.insert(OIS::ParamList::value_type("w32_mouse", "DISCL_NONEXCLUSIVE"));
492  pl.insert(OIS::ParamList::value_type("w32_keyboard", "DISCL_FOREGROUND"));
493  pl.insert(OIS::ParamList::value_type("w32_keyboard", "DISCL_NONEXCLUSIVE"));
494 #endif // LINUX
495  }
496 
497 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
498  if (App::io_input_grab_mode->getEnum<IoInputGrabMode>() != IoInputGrabMode::ALL)
499  {
500  ShowCursor(FALSE);
501  }
502  else
503  {
504  ShowCursor(TRUE); // To make `MSG_APP_REINIT_INPUT_REQUESTED` work correctly
505  }
506 #endif
507 
508  mInputManager = OIS::InputManager::createInputSystem(pl);
509 
510  //Print debugging information
511  unsigned int v = mInputManager->getVersionNumber();
512  LOG("OIS Version: " + TOSTRING(v>>16) + String(".") + TOSTRING((v>>8) & 0x000000FF) + String(".") + TOSTRING(v & 0x000000FF));
513  LOG("+ Release Name: " + mInputManager->getVersionName());
514  LOG("+ Manager: " + mInputManager->inputSystemName());
515  LOG("+ Total Keyboards: " + TOSTRING(mInputManager->getNumberOfDevices(OISKeyboard)));
516  LOG("+ Total Mice: " + TOSTRING(mInputManager->getNumberOfDevices(OISMouse)));
517  LOG("+ Total JoySticks: " + TOSTRING(mInputManager->getNumberOfDevices(OISJoyStick)));
518 
519  //List all devices
520  OIS::DeviceList deviceList = mInputManager->listFreeDevices();
521  for (OIS::DeviceList::iterator i = deviceList.begin(); i != deviceList.end(); ++i)
522  LOG("* Device: " + String(mOISDeviceType[i->first]) + String(" Vendor: ") + i->second);
523 
524  //Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse)
525  mKeyboard = 0;
526 
527  try
528  {
529  mKeyboard = static_cast<Keyboard*>(mInputManager->createInputObject(OISKeyboard, true));
530  mKeyboard->setTextTranslation(OIS::Keyboard::Unicode);
531  }
532  catch (OIS::Exception& ex)
533  {
534  LOG(String("Exception raised on keyboard creation: ") + String(ex.eText));
535  }
536 
537 
538  try
539  {
540  //This demo uses at most 10 joysticks - use old way to create (i.e. disregard vendor)
541  int numSticks = std::min(mInputManager->getNumberOfDevices(OISJoyStick), 10);
542  free_joysticks = 0;
543  for (int i = 0; i < numSticks; ++i)
544  {
545  mJoy[i] = (JoyStick*)mInputManager->createInputObject(OISJoyStick, true);
546  free_joysticks++;
547  //create force feedback too
548  //here, we take the first device we can get, but we could take a device index
549  if (!mForceFeedback)
550  mForceFeedback = (OIS::ForceFeedback*)mJoy[i]->queryInterface(OIS::Interface::ForceFeedback);
551 
552  LOG("Creating Joystick " + TOSTRING(i + 1) + " (" + mJoy[i]->vendor() + ")");
553  LOG("* Axes: " + TOSTRING(mJoy[i]->getNumberOfComponents(OIS_Axis)));
554  LOG("* Sliders: " + TOSTRING(mJoy[i]->getNumberOfComponents(OIS_Slider)));
555  LOG("* POV/HATs: " + TOSTRING(mJoy[i]->getNumberOfComponents(OIS_POV)));
556  LOG("* Buttons: " + TOSTRING(mJoy[i]->getNumberOfComponents(OIS_Button)));
557  LOG("* Vector3: " + TOSTRING(mJoy[i]->getNumberOfComponents(OIS_Vector3)));
558  }
559  }
560  catch (OIS::Exception& ex)
561  {
562  LOG(String("Exception raised on joystick creation: ") + String(ex.eText));
563  }
564 
565  try
566  {
567  mMouse = static_cast<Mouse*>(mInputManager->createInputObject(OISMouse, true));
568  }
569  catch (OIS::Exception& ex)
570  {
571  LOG(String("Exception raised on mouse creation: ") + String(ex.eText));
572  }
573 
574 
575  if (free_joysticks)
576  {
577  for (int i = 0; i < free_joysticks; i++)
578  joyState[i] = mJoy[i]->getJoyStickState();
579  }
580 
581  // set the mouse to the middle of the screen, hackish!
582 #if _WIN32
583  // under linux, this will not work and the cursor will never reach (0,0)
584  if (mMouse && RoR::App::GetAppContext()->GetRenderWindow())
585  {
586  OIS::MouseState& mutableMouseState = const_cast<OIS::MouseState &>(mMouse->getMouseState());
587  mutableMouseState.X.abs = RoR::App::GetAppContext()->GetRenderWindow()->getWidth() * 0.5f;
588  mutableMouseState.Y.abs = RoR::App::GetAppContext()->GetRenderWindow()->getHeight() * 0.5f;
589  }
590 #endif // _WIN32
591 
592  // load default mappings
593  this->loadConfigFile(-1);
594 
595  // then load device (+OS) specific mappings
596  for (int i = 0; i < free_joysticks; ++i)
597  {
598  this->loadConfigFile(i);
599  }
601 }
602 
603 OIS::MouseState InputEngine::getMouseState()
604 {
605  // When window regains focus, OIS sends a fake LMB-down event, which is never followed by a LMB-up event.
606  // See commentary in `resetKeysAndMouseButtons()`
607  // To work around, we keep internal button states and pay attention not to get them polluted by OIS.
608  // -----------------------------------------------------------------------------------------------------
609  return mouseState;
610 }
611 
612 String InputEngine::getKeyNameForKeyCode(OIS::KeyCode keycode)
613 {
614  if (keycode == KC_LSHIFT || keycode == KC_RSHIFT)
615  return "SHIFT";
616  if (keycode == KC_LCONTROL || keycode == KC_RCONTROL)
617  return "CTRL";
618  if (keycode == KC_LMENU || keycode == KC_RMENU)
619  return "ALT";
620  for (allit = allkeys.begin(); allit != allkeys.end(); allit++)
621  {
622  if (allit->second == keycode)
623  return allit->first;
624  }
625  return "unknown";
626 }
627 
629 {
630  mKeyboard->capture();
631  mMouse->capture();
632 
633  for (int i = 0; i < free_joysticks; i++)
634  {
635  if (mJoy[i])
636  {
637  mJoy[i]->capture();
638  }
639  }
640 
642 }
643 
644 void InputEngine::windowResized(Ogre::RenderWindow* rw)
645 {
646  //update mouse area
647  unsigned int width, height, depth;
648  int left, top;
649  rw->getMetrics(width, height, depth, left, top);
650  const OIS::MouseState& ms = mMouse->getMouseState();
651  ms.width = width;
652  ms.height = height;
653 }
654 
655 void InputEngine::SetKeyboardListener(OIS::KeyListener* keyboard_listener)
656 {
657  ROR_ASSERT(mKeyboard != nullptr);
658  mKeyboard->setEventCallback(keyboard_listener);
659 }
660 
661 void InputEngine::SetMouseListener(OIS::MouseListener* mouse_listener)
662 {
663  ROR_ASSERT(mMouse != nullptr);
664  mMouse->setEventCallback(mouse_listener);
665 }
666 
667 void InputEngine::SetJoystickListener(OIS::JoyStickListener* obj)
668 {
669  for (int i = 0; i < free_joysticks; i++)
670  {
671  mJoy[i]->setEventCallback(obj);
672  }
673 }
674 
675 /* --- Joystick Events ------------------------------------------ */
676 void InputEngine::ProcessJoystickEvent(const OIS::JoyStickEvent& arg)
677 {
678  int i = arg.device->getID();
679  if (i < 0 || i >= MAX_JOYSTICKS)
680  i = 0;
681  joyState[i] = arg.state;
682 }
683 
684 /* --- Key Events ------------------------------------------ */
685 void InputEngine::ProcessKeyPress(const OIS::KeyEvent& arg)
686 {
687  keyState[arg.key] = 1;
688 }
689 
690 void InputEngine::ProcessKeyRelease(const OIS::KeyEvent& arg)
691 {
692  keyState[arg.key] = 0;
693 }
694 
695 /* --- Mouse Events ------------------------------------------ */
696 void InputEngine::processMouseMotionEvent(const OIS::MouseEvent& arg)
697 {
698  // Only pick position info; button info may be dirty, see commentary in `getMouseState()`
699  mouseState.X = arg.state.X;
700  mouseState.Y = arg.state.Y;
701  mouseState.Z = arg.state.Z;
702 }
703 
704 void InputEngine::processMousePressEvent(const OIS::MouseEvent& arg, OIS::MouseButtonID _id)
705 {
706  // Skip false 'LMB press' event after restoring window focus; see commentary in `resetKeysAndMouseButtons()`.
707  if (_id == OIS::MB_Left)
708  {
710  {
711  return;
712  }
714  }
715 
716  // Only update the one particular button, OIS's persistent state may be dirty, see commentary in `getMouseState()`
717  BitMask_t btnmask = 1 << _id;
718  BITMASK_SET_1(mouseState.buttons, btnmask);
719 }
720 
721 void InputEngine::processMouseReleaseEvent(const OIS::MouseEvent& arg, OIS::MouseButtonID _id)
722 {
723  // Only update the one particular button, OIS's persistent state may be dirty, see commentary in `getMouseState()`
724  BitMask_t btnmask = 1 << _id;
725  BITMASK_SET_0(mouseState.buttons, btnmask);
726 }
727 
728 /* --- Custom Methods ------------------------------------------ */
730 {
731  for (std::map<int, bool>::iterator iter = keyState.begin(); iter != keyState.end(); ++iter)
732  {
733  iter->second = false;
734  }
735 
736  // OIS WORKAROUND: After a window focus is restored for the 2nd+ time, OIS delivers a fabricated 'LMB pressed' event,
737  // without ever sending matching 'LMB released', see analysis: https://github.com/RigsOfRods/rigs-of-rods/pull/3184#issuecomment-2380397463
738  // This has a very prominent negative effect, see https://github.com/RigsOfRods/rigs-of-rods/issues/2468
739  // There's no way to recognize the event as fake, we must track number of frames and LMB presses since last reset.
742 
743  // Reset internal button states; see commentary in `getMouseState()`
744  mouseState.buttons = 0;
745 }
746 
748 {
749  event_values_simulated[eventID] = value;
750 }
751 
753 {
754  event_states_supressed[eventID] = supress;
755 }
756 
758 {
759  return (getEventValue(eventID) > 0.5f);
760 }
761 
762 bool InputEngine::getEventBoolValueBounce(int eventID, float time)
763 {
764  if (event_times[eventID] > 0)
765  return false;
766  else
767  {
768  bool res = getEventBoolValue(eventID);
769  if (res)
770  event_times[eventID] = time;
771  return res;
772  }
773 }
774 
776 {
777  return event_times[eventID];
778 }
779 
781 {
782  for (std::map<int, float>::iterator it = event_times.begin(); it != event_times.end(); it++)
783  {
784  if (it->second > 0)
785  it->second -= dt;
786  //else
787  // erase element?
788  }
789 }
790 
791 float InputEngine::deadZone(float axisValue, float dz)
792 {
793  // no deadzone?
794  if (dz < 0.0001f)
795  return axisValue;
796 
797  // check for deadzone
798  if (fabs(axisValue) < dz)
799  // dead zone case
800  return 0.0f;
801  else
802  // non-deadzone, remap the remaining part
803  return (axisValue - dz) * (1.0f / (1.0f - dz));
804 }
805 
806 float InputEngine::axisLinearity(float axisValue, float linearity)
807 {
808  return (axisValue * linearity);
809 }
810 
811 float InputEngine::logval(float val)
812 {
813  if (val > 0)
814  return log10(1.0 / (1.1 - val)) / 1.0;
815  if (val == 0)
816  return 0;
817  return -log10(1.0 / (1.1 + val)) / 1.0;
818 }
819 
820 String InputEngine::getEventCommand(int eventID)
821 {
822  std::vector<event_trigger_t>& t_vec = events[eventID];
823  if (t_vec.size() > 0)
824  {
825  // TODO: handle multiple mappings for one event code - currently we only check the first one.
826  return this->composeEventCommandString(t_vec[0]);
827  }
828  return "";
829 }
830 
831 std::string InputEngine::getEventCommandTrimmed(int eventID)
832 {
833  std::string result = regex_replace(App::GetInputEngine()->getEventCommand(eventID).c_str(), std::regex("EXPL\\+"), "");
834  return result;
835 }
836 
838 {
839  return this->composeEventCommandString(evt);
840 }
841 
842 String InputEngine::getEventConfig(int eventID)
843 {
844  std::vector<event_trigger_t>& t_vec = events[eventID];
845  if (t_vec.size() > 0)
846  {
847  // TODO: handle multiple mappings for one event code - currently we only check the first one.
848  return this->composeEventConfigString(t_vec[0]);
849  }
850  return "";
851 }
852 
854 {
855  for (int i = 0; i < EV_MODE_LAST; i++)
856  {
857  if (eventInfo[i].eventID == eventID)
858  {
859  return eventInfo[i].defaultKey;
860  }
861  }
862  return "";
863 }
864 
866 {
867  switch (trig.eventtype)
868  {
869  case ET_Keyboard:
870  case ET_JoystickButton:
871  return trig.configline; // Configline contains the key/button
872 
873  case ET_JoystickPov:
874  return fmt::format("{} {}", trig.joystickPovNumber, trig.configline); // Configline contains the direction - display it.
875 
876  case ET_JoystickSliderX:
877  return fmt::format("X {}", trig.joystickSliderNumber); // Must show axis separately. Configline contains just the options.
878 
879  case ET_JoystickSliderY:
880  return fmt::format("Y {}", trig.joystickSliderNumber); // Must show axis separately. Configline contains just the options.
881 
882  default: // Joystick axes
883  return fmt::format("{}", trig.joystickAxisNumber); // Configline contains just the options.
884  }
885 }
886 
888 {
889  switch (trig.eventtype)
890  {
891  case ET_Keyboard:
892  case ET_JoystickButton:
893  case ET_JoystickPov:
894  return this->composeEventCommandString(trig);
895 
896  // Sliders: Include redundant X/Y and options.
897  case ET_JoystickSliderX:
898  return fmt::format("X {} {}", trig.joystickSliderNumber, trig.configline); // Configline contains just the options.
899  case ET_JoystickSliderY:
900  return fmt::format("Y {} {}", trig.joystickSliderNumber, trig.configline); // Configline contains just the options.
901 
902  // Joystick axes and sliders - include options.
903  default:
904  return fmt::format("{} {}", trig.joystickAxisNumber, trig.configline); // Configline contains just the options.
905  }
906 }
907 
909 {
910  std::vector<event_trigger_t> t_vec = events[eventID];
911  if (t_vec.size() > 0)
912  {
913  if (t_vec[0].eventtype != ET_NONE) // TODO: handle multiple mappings for one event code - currently we only check the first one.
914  return true;
915  }
916  return false;
917 }
918 
920 {
921  std::vector<event_trigger_t> t_vec = events[eventID];
922  for (std::vector<event_trigger_t>::iterator i = t_vec.begin(); i != t_vec.end(); i++)
923  {
924  event_trigger_t t = *i;
925  if (t.eventtype == ET_Keyboard)
926  return t.keyCode;
927  }
928  return -1;
929 }
930 
931 bool InputEngine::isEventAnalog(int eventID)
932 {
933  std::vector<event_trigger_t> t_vec = events[eventID];
934  if (t_vec.size() > 0)
935  {
936  //loop through all eventtypes, because we want to find a analog device wether it is the first device or not
937  //this means a analog device is always preferred over a digital one
938  for (unsigned int i = 0; i < t_vec.size(); i++)
939  {
940  if ((t_vec[i].eventtype == ET_MouseAxisX
941  || t_vec[i].eventtype == ET_MouseAxisY
942  || t_vec[i].eventtype == ET_MouseAxisZ
943  || t_vec[i].eventtype == ET_JoystickAxisAbs
944  || t_vec[i].eventtype == ET_JoystickAxisRel
945  || t_vec[i].eventtype == ET_JoystickSliderX
946  || t_vec[i].eventtype == ET_JoystickSliderY)
947  //check if value comes from analog device
948  //this way, only valid events (e.g. joystick mapped, but unplugged) are recognized as analog events
949  && getEventValue(eventID, true, InputSourceType::IST_ANALOG) != 0.0)
950  {
951  return true;
952  }
953  }
954  }
955  return false;
956 }
957 
958 float InputEngine::getEventValue(int eventID, bool pure, InputSourceType valueSource /*= InputSourceType::IST_ANY*/)
959 {
960  const float simulatedValue = event_values_simulated[eventID];
961  if (simulatedValue != 0.f)
962  return simulatedValue;
963 
964  if (event_states_supressed[eventID])
965  return 0.f;
966 
967  float returnValue = 0;
968  std::vector<event_trigger_t> t_vec = events[eventID];
969  float value = 0;
970  for (std::vector<event_trigger_t>::iterator i = t_vec.begin(); i != t_vec.end(); i++)
971  {
972  event_trigger_t t = *i;
973 
974  if (valueSource == InputSourceType::IST_DIGITAL || valueSource == InputSourceType::IST_ANY)
975  {
976  switch (t.eventtype)
977  {
978  case ET_NONE:
979  break;
980  case ET_Keyboard:
981  if (!keyState[t.keyCode])
982  break;
983 
984  // only use explicite mapping, if two keys with different modifiers exist, i.e. F1 and SHIFT+F1.
985  // check for modificators
986  if (t.explicite)
987  {
988  if (t.ctrl != (keyState[KC_LCONTROL] || keyState[KC_RCONTROL]))
989  break;
990  if (t.shift != (keyState[KC_LSHIFT] || keyState[KC_RSHIFT]))
991  break;
992  if (t.alt != (keyState[KC_LMENU] || keyState[KC_RMENU]))
993  break;
994  }
995  else
996  {
997  if (t.ctrl && !(keyState[KC_LCONTROL] || keyState[KC_RCONTROL]))
998  break;
999  if (t.shift && !(keyState[KC_LSHIFT] || keyState[KC_RSHIFT]))
1000  break;
1001  if (t.alt && !(keyState[KC_LMENU] || keyState[KC_RMENU]))
1002  break;
1003  }
1004  value = 1;
1005  break;
1006  case ET_MouseButton:
1007  //if (t.mouseButtonNumber == 0)
1008  // TODO: FIXME
1009  value = mouseState.buttonDown(MB_Left);
1010  break;
1011  case ET_JoystickButton:
1012  {
1014  {
1015  value = 0;
1016  continue;
1017  }
1018  if (t.joystickButtonNumber >= (int)mJoy[t.joystickNumber]->getNumberOfComponents(OIS_Button))
1019  {
1020 #ifndef NOOGRE
1021  LOG("*** Joystick has not enough buttons for mapping: need button "+TOSTRING(t.joystickButtonNumber) + ", availabe buttons: "+TOSTRING(mJoy[t.joystickNumber]->getNumberOfComponents(OIS_Button)));
1022 #endif
1023  value = 0;
1024  continue;
1025  }
1026  value = joyState[t.joystickNumber].mButtons[t.joystickButtonNumber];
1027  }
1028  break;
1029  case ET_JoystickPov:
1030  {
1032  {
1033  value = 0;
1034  continue;
1035  }
1036  if (t.joystickPovNumber >= (int)mJoy[t.joystickNumber]->getNumberOfComponents(OIS_POV))
1037  {
1038 #ifndef NOOGRE
1039  LOG("*** Joystick has not enough POVs for mapping: need POV "+TOSTRING(t.joystickPovNumber) + ", availabe POVs: "+TOSTRING(mJoy[t.joystickNumber]->getNumberOfComponents(OIS_POV)));
1040 #endif
1041  value = 0;
1042  continue;
1043  }
1044  if (joyState[t.joystickNumber].mPOV[t.joystickPovNumber].direction & t.joystickPovDirection)
1045  value = 1;
1046  else
1047  value = 0;
1048  }
1049  break;
1050  }
1051  }
1052  if (valueSource == InputSourceType::IST_ANALOG || valueSource == InputSourceType::IST_ANY)
1053  {
1054  switch (t.eventtype)
1055  {
1056  case ET_MouseAxisX:
1057  value = mouseState.X.abs / 32767;
1058  break;
1059  case ET_MouseAxisY:
1060  value = mouseState.Y.abs / 32767;
1061  break;
1062  case ET_MouseAxisZ:
1063  value = mouseState.Z.abs / 32767;
1064  break;
1065 
1066  case ET_JoystickAxisRel:
1067  case ET_JoystickAxisAbs:
1068  {
1070  {
1071  value = 0;
1072  continue;
1073  }
1074  if (t.joystickAxisNumber >= (int)joyState[t.joystickNumber].mAxes.size())
1075  {
1076 #ifndef NOOGRE
1077  LOG("*** Joystick has not enough axis for mapping: need axe "+TOSTRING(t.joystickAxisNumber) + ", availabe axis: "+TOSTRING(joyState[t.joystickNumber].mAxes.size()));
1078 #endif
1079  value = 0;
1080  continue;
1081  }
1082  Axis axe = joyState[t.joystickNumber].mAxes[t.joystickAxisNumber];
1083 
1084  if (t.eventtype == ET_JoystickAxisRel)
1085  {
1086  value = (float)axe.rel / (float)mJoy[t.joystickNumber]->MAX_AXIS;
1087  }
1088  else
1089  {
1090  value = (float)axe.abs / (float)mJoy[t.joystickNumber]->MAX_AXIS;
1091  switch (t.joystickAxisRegion)
1092  {
1093  case 0:
1094  // normal case, full axis used
1095  value = (value + 1) / 2;
1096  break;
1097  case -1:
1098  // lower range used
1099  if (value > 0)
1100  value = 0;
1101  else
1102  value = -value;
1103  break;
1104  case 1:
1105  // upper range used
1106  if (value < 0)
1107  value = 0;
1108  break;
1109  }
1110 
1111  if (t.joystickAxisHalf)
1112  {
1113  // XXX: TODO: write this
1114  //float a = (double)((value+1.0)/2.0);
1115  //float b = (double)(1.0-(value+1.0)/2.0);
1116  //LOG("half: "+TOSTRING(value)+" / "+TOSTRING(a)+" / "+TOSTRING(b));
1117  //no dead zone in half axis
1118  value = (1.0 + value) / 2.0;
1119  if (t.joystickAxisReverse)
1120  value = 1.0 - value;
1121  if (!pure)
1122  value = axisLinearity(value, t.joystickAxisLinearity);
1123  }
1124  else
1125  {
1126  //LOG("not half: "+TOSTRING(value)+" / "+TOSTRING(deadZone(value, t.joystickAxisDeadzone)) +" / "+TOSTRING(t.joystickAxisDeadzone) );
1127  if (t.joystickAxisReverse)
1128  value = 1 - value;
1129  if (!pure)
1130  // no deadzone when using oure value
1131  value = deadZone(value, t.joystickAxisDeadzone);
1132  if (!pure)
1133  value = axisLinearity(value, t.joystickAxisLinearity);
1134  }
1135  // digital mapping of analog axis
1136  if (t.joystickAxisUseDigital)
1137  if (value >= 0.5)
1138  value = 1;
1139  else
1140  value = 0;
1141  }
1142  }
1143  break;
1144  case ET_JoystickSliderX:
1145  case ET_JoystickSliderY:
1146  {
1148  {
1149  value = 0;
1150  continue;
1151  }
1152  if (t.eventtype == ET_JoystickSliderX)
1153  value = (float)joyState[t.joystickNumber].mSliders[t.joystickSliderNumber].abX / (float)mJoy[t.joystickNumber]->MAX_AXIS;
1154  else if (t.eventtype == ET_JoystickSliderY)
1155  value = (float)joyState[t.joystickNumber].mSliders[t.joystickSliderNumber].abY / (float)mJoy[t.joystickNumber]->MAX_AXIS;
1156  value = (value + 1) / 2; // full axis
1157  if (t.joystickSliderReverse)
1158  value = 1.0 - value; // reversed
1159  }
1160  break;
1161  }
1162  }
1163  // only return if grater zero, otherwise check all other bombinations
1164  if (value > returnValue)
1165  returnValue = value;
1166  }
1167  return returnValue;
1168 }
1169 
1170 bool InputEngine::isKeyDown(OIS::KeyCode key)
1171 {
1172  if (!mKeyboard)
1173  return false;
1174  return this->mKeyboard->isKeyDown(key);
1175 }
1176 
1177 bool InputEngine::isKeyDownEffective(OIS::KeyCode mod)
1178 {
1179  return this->keyState[mod];
1180 }
1181 
1182 bool InputEngine::isKeyDownValueBounce(OIS::KeyCode mod, float time)
1183 {
1184  if (event_times[-mod] > 0)
1185  return false;
1186  else
1187  {
1188  bool res = isKeyDown(mod);
1189  if (res)
1190  event_times[-mod] = time;
1191  return res;
1192  }
1193 }
1194 
1196 {
1197  switch (evt.eventtype)
1198  {
1199  case ET_NONE:
1200  return "None";
1201  case ET_Keyboard:
1202  return "Keyboard";
1203  case ET_MouseButton:
1204  case ET_MouseAxisX:
1205  case ET_MouseAxisY:
1206  case ET_MouseAxisZ:
1207  return "Mouse";
1208  case ET_JoystickButton:
1209  case ET_JoystickAxisAbs:
1210  case ET_JoystickAxisRel:
1211  case ET_JoystickPov:
1212  case ET_JoystickSliderX:
1213  case ET_JoystickSliderY:
1214  return "Joystick: " + getJoyVendor(evt.joystickNumber);
1215  }
1216  return "unknown";
1217 }
1218 
1219 // static
1221 {
1222  switch (type)
1223  {
1224  case ET_NONE: return "None";
1225  case ET_Keyboard: return "Keyboard";
1226  case ET_MouseButton: return "MouseButton";
1227  case ET_MouseAxisX: return "MouseAxisX";
1228  case ET_MouseAxisY: return "MouseAxisY";
1229  case ET_MouseAxisZ: return "MouseAxisZ";
1230  case ET_JoystickButton: return "JoystickButton";
1231  case ET_JoystickAxisAbs:
1232  case ET_JoystickAxisRel: return "JoystickAxis"; // Default is 'abs', 'rel' is created by option RELATIVE.
1233  case ET_JoystickPov: return "JoystickPov";
1234  case ET_JoystickSliderX:
1235  case ET_JoystickSliderY: return "JoystickSlider"; // Axis is given by special parameter.
1236  default: return "unknown";
1237  }
1238 }
1239 
1241 {
1242  this->addEvent(eventID);
1243  events[eventID].push_back(t);
1244 }
1245 
1246 void InputEngine::addEvent(int eventID)
1247 {
1248  uniqueCounter++;
1249 
1250  if (eventID == -1)
1251  //unknown event, discard
1252  return;
1253  if (events.find(eventID) == events.end())
1254  {
1255  events[eventID] = std::vector<event_trigger_t>();
1256  event_values_simulated[eventID] = 0.f;
1257  event_states_supressed[eventID] = false;
1258  }
1259 }
1260 
1261 void InputEngine::addEventDefault(int eventID, int deviceID /*= -1*/)
1262 {
1263  if (eventID == -1)
1264  //unknown event, discard
1265  return;
1266 
1267  std::string line = fmt::format("{} {}", this->eventIDToName(eventID), this->getEventDefaultConfig(eventID));
1268  this->processLine(line.c_str(), deviceID);
1269 }
1270 
1271 void InputEngine::updateEvent(int eventID, const event_trigger_t& t)
1272 {
1273  if (eventID == -1)
1274  //unknown event, discard
1275  return;
1276  if (events.find(eventID) == events.end())
1277  {
1278  events[eventID] = std::vector<event_trigger_t>();
1279  events[eventID].clear();
1280  }
1281  events[eventID].push_back(t);
1282 }
1283 
1284 void InputEngine::eraseEvent(int eventID, const event_trigger_t* t)
1285 {
1286  if (events.find(eventID) != events.end())
1287  {
1288  TriggerVec& triggers = events[eventID];
1289  for (size_t i = 0; i < triggers.size(); i++)
1290  {
1291  if (t == &triggers[i])
1292  {
1293  triggers.erase(triggers.begin() + i);
1294  return;
1295  }
1296  }
1297  }
1298 }
1299 
1300 void InputEngine::clearEvents(int eventID)
1301 {
1302  if (events.find(eventID) != events.end())
1303  {
1304  events[eventID].clear();
1305  }
1306 }
1307 
1309 {
1310  for (auto& ev_pair: events)
1311  {
1312  if (ev_pair.second.size() > 0)
1313  {
1314  auto itor = ev_pair.second.begin();
1315  while (itor != ev_pair.second.end())
1316  {
1317  if (itor->configDeviceID == deviceID)
1318  itor = ev_pair.second.erase(itor);
1319  else
1320  itor++;
1321  }
1322  }
1323  }
1324 }
1325 
1327 {
1328  events.clear(); // remove all bindings
1329  this->resetKeysAndMouseButtons(); // reset input states
1330 }
1331 
1332 bool InputEngine::processLine(const char* line, int deviceID)
1333 {
1334  static String cur_comment = "";
1335 
1336  char eventName[256] = "", evtype[256] = "";
1337  const char delimiters[] = "+";
1338  size_t linelen = strnlen(line, 1024);
1339  enum eventtypes eventtype = ET_NONE;
1340 
1341  int joyNo = 0;
1342  float defaultDeadzone = 0.1f;
1343  float defaultLinearity = 1.0f;
1344  if (line[0] == ';' || linelen < 5)
1345  {
1346  cur_comment += line;;
1347  return false;
1348  }
1349  sscanf(line, "%s %s", eventName, evtype);
1350  if (strnlen(eventName, 255) == 0 || strnlen(evtype, 255) == 0)
1351  return false;
1352 
1353  if (!strncmp(evtype, "Keyboard", 8))
1354  eventtype = ET_Keyboard;
1355  else if (!strncmp(evtype, "MouseButton", 10))
1356  eventtype = ET_MouseButton;
1357  else if (!strncmp(evtype, "MouseAxisX", 9))
1358  eventtype = ET_MouseAxisX;
1359  else if (!strncmp(evtype, "MouseAxisY", 9))
1360  eventtype = ET_MouseAxisY;
1361  else if (!strncmp(evtype, "MouseAxisZ", 9))
1362  eventtype = ET_MouseAxisZ;
1363  else if (!strncmp(evtype, "JoystickButton", 14))
1364  eventtype = ET_JoystickButton;
1365  else if (!strncmp(evtype, "JoystickAxis", 12))
1366  eventtype = ET_JoystickAxisAbs;
1367  //else if (!strncmp(evtype, "JoystickAxis", 250)) eventtype = ET_JoystickAxisRel;
1368  else if (!strncmp(evtype, "JoystickPov", 11))
1369  eventtype = ET_JoystickPov;
1370  else if (!strncmp(evtype, "JoystickSlider", 14))
1371  eventtype = ET_JoystickSliderX;
1372  else if (!strncmp(evtype, "JoystickSliderX", 15))
1373  eventtype = ET_JoystickSliderX;
1374  else if (!strncmp(evtype, "JoystickSliderY", 15))
1375  eventtype = ET_JoystickSliderY;
1376  else if (!strncmp(evtype, "None", 4))
1377  eventtype = ET_NONE;
1378 
1379  switch (eventtype)
1380  {
1381  case ET_Keyboard:
1382  {
1383  bool alt = false;
1384  bool shift = false;
1385  bool ctrl = false;
1386  bool expl = false;
1387 
1388  char* keycode = 0;
1389  char keycodes[256] = {};
1390  char keycodes_work[256] = {};
1391 
1392  OIS::KeyCode key = KC_UNASSIGNED;
1393 
1394  sscanf(line, "%s %s %s", eventName, evtype, keycodes);
1395  // separate all keys and construct the key combination
1396  //LOG("try to add key: " + String(eventName)+","+ String(evtype)+","+String(keycodes));
1397  strncpy(keycodes_work, keycodes, 255);
1398  keycodes_work[255] = '\0';
1399  char* token = strtok(keycodes_work, delimiters);
1400 
1401  while (token != NULL)
1402  {
1403  if (strncmp(token, "SHIFT", 5) == 0)
1404  shift = true;
1405  else if (strncmp(token, "CTRL", 4) == 0)
1406  ctrl = true;
1407  else if (strncmp(token, "ALT", 3) == 0)
1408  alt = true;
1409  else if (strncmp(token, "EXPL", 4) == 0)
1410  expl = true;
1411  keycode = token;
1412  token = strtok(NULL, delimiters);
1413  }
1414 
1415  allit = allkeys.find(keycode);
1416  if (allit == allkeys.end())
1417  {
1418 #ifndef NOOGRE
1419  LOG("unknown key: " + string(keycodes));
1420 #endif
1421  key = KC_UNASSIGNED;
1422  }
1423  else
1424  {
1425  //LOG("found key: " + string(keycode) + " = " + TOSTRING((int)key));
1426  key = allit->second;
1427  }
1428  int eventID = resolveEventName(String(eventName));
1429  if (eventID == -1)
1430  {
1431  LOG("Error while processing input config: Unknown Event: "+String(eventName));
1432  return false;
1433  }
1434  event_trigger_t t_key = newEvent();
1435  t_key.configDeviceID = deviceID;
1436  t_key.eventtype = ET_Keyboard;
1437  t_key.shift = shift;
1438  t_key.ctrl = ctrl;
1439  t_key.alt = alt;
1440  t_key.keyCode = key;
1441  t_key.explicite = expl;
1442 
1443  strncpy(t_key.configline, keycodes, 128);
1444  strncpy(t_key.group, getEventGroup(eventName).c_str(), 128);
1445  strncpy(t_key.tmp_eventname, eventName, 128);
1446 
1447  strncpy(t_key.comments, cur_comment.c_str(), 1024);
1448  addEvent(eventID, t_key);
1449 
1450  return true;
1451  }
1452  case ET_JoystickButton:
1453  {
1454  int buttonNo = 0;
1455  char tmp2[256] = {};
1456  sscanf(line, "%s %s %d %d %s", eventName, evtype, &joyNo, &buttonNo, tmp2);
1457  event_trigger_t t_joy = newEvent();
1458  t_joy.configDeviceID = deviceID;
1459  int eventID = resolveEventName(String(eventName));
1460  if (eventID == -1)
1461  return false;
1462  t_joy.eventtype = ET_JoystickButton;
1463  t_joy.joystickNumber = (deviceID == -1 ? joyNo : deviceID);
1464  t_joy.joystickButtonNumber = buttonNo;
1465  if (!strcmp(tmp2, "!NEW!"))
1466  {
1467  strncpy(t_joy.configline, tmp2, 128);
1468  }
1469  else
1470  {
1471  char tmp[256] = {};
1472  sprintf(tmp, "%d", buttonNo);
1473  strncpy(t_joy.configline, tmp, 128);
1474  }
1475  strncpy(t_joy.group, getEventGroup(eventName).c_str(), 128);
1476  strncpy(t_joy.tmp_eventname, eventName, 128);
1477  strncpy(t_joy.comments, cur_comment.c_str(), 1024);
1478  cur_comment = "";
1479  addEvent(eventID, t_joy);
1480  return true;
1481  }
1482  case ET_JoystickAxisRel:
1483  case ET_JoystickAxisAbs:
1484  {
1485  int axisNo = 0;
1486  char options[256] = {};
1487  sscanf(line, "%s %s %d %d %s", eventName, evtype, &joyNo, &axisNo, options);
1488  int eventID = resolveEventName(String(eventName));
1489  if (eventID == -1)
1490  return false;
1491 
1492  bool half = false;
1493  bool reverse = false;
1494  bool linear = false;
1495  bool relative = false;
1496  bool usedigital = false;
1497  float deadzone = defaultDeadzone;
1498  float linearity = defaultLinearity;
1499  int jAxisRegion = 0;
1500  // 0 = all
1501  // -1 = lower
1502  // 1 = upper
1503  char tmp[256] = {};
1504  strcpy(tmp, options);
1505  tmp[255] = '\0';
1506  char* token = strtok(tmp, delimiters);
1507  while (token != NULL)
1508  {
1509  if (strncmp(token, "HALF", 4) == 0)
1510  half = true;
1511  else if (strncmp(token, "REVERSE", 7) == 0)
1512  reverse = true;
1513  else if (strncmp(token, "LINEAR", 6) == 0)
1514  linear = true;
1515  else if (strncmp(token, "UPPER", 5) == 0)
1516  jAxisRegion = 1;
1517  else if (strncmp(token, "LOWER", 5) == 0)
1518  jAxisRegion = -1;
1519  else if (strncmp(token, "RELATIVE", 8) == 0)
1520  relative = true;
1521  else if (strncmp(token, "DIGITAL", 7) == 0)
1522  usedigital = true;
1523  else if (strncmp(token, "DEADZONE", 8) == 0 && strnlen(token, 250) > 9)
1524  {
1525  char tmp2[256] = {};
1526  strcpy(tmp2, token + 9);
1527  deadzone = atof(tmp2);
1528  //LOG("got deadzone: " + TOSTRING(deadzone)+", "+String(tmp2));
1529  }
1530  else if (strncmp(token, "LINEARITY", 9) == 0 && strnlen(token, 250) > 10)
1531  {
1532  char tmp2[256] = {};
1533  strcpy(tmp2, token + 10);
1534  linearity = atof(tmp2);
1535  }
1536  token = strtok(NULL, delimiters);
1537  }
1538 
1539  if (relative)
1540  eventtype = ET_JoystickAxisRel;
1541 
1542  event_trigger_t t_joy = newEvent();
1543  t_joy.configDeviceID = deviceID;
1544  t_joy.eventtype = eventtype;
1545  t_joy.joystickAxisRegion = jAxisRegion;
1546  t_joy.joystickAxisUseDigital = usedigital;
1547  t_joy.joystickAxisDeadzone = deadzone;
1548  t_joy.joystickAxisHalf = half;
1549  t_joy.joystickAxisLinearity = linearity;
1550  t_joy.joystickAxisReverse = reverse;
1551  t_joy.joystickAxisNumber = axisNo;
1552  t_joy.joystickNumber = (deviceID == -1 ? joyNo : deviceID);
1553  strncpy(t_joy.configline, options, 128);
1554  strncpy(t_joy.group, getEventGroup(eventName).c_str(), 128);
1555  strncpy(t_joy.tmp_eventname, eventName, 128);
1556  strncpy(t_joy.comments, cur_comment.c_str(), 1024);
1557  cur_comment = "";
1558  addEvent(eventID, t_joy);
1559  //LOG("added axis: " + TOSTRING(axisNo));
1560  return true;
1561  }
1562  case ET_NONE:
1563  {
1564  int eventID = resolveEventName(String(eventName));
1565  if (eventID == -1)
1566  return false;
1567  // Insert event with no trigger
1568  addEvent(eventID);
1569  return true;
1570  }
1571  case ET_MouseButton:
1572  case ET_MouseAxisX:
1573  case ET_MouseAxisY:
1574  case ET_MouseAxisZ:
1575  // no mouse support D:
1576  return false;
1577  case ET_JoystickPov:
1578  {
1579  int povNumber = 0;
1580  char dir[256] = {};
1581  sscanf(line, "%s %s %d %d %s", eventName, evtype, &joyNo, &povNumber, dir);
1582  int eventID = resolveEventName(String(eventName));
1583  if (eventID == -1)
1584  return false;
1585 
1586  int direction = OIS::Pov::Centered;
1587  if (!strcmp(dir, "North"))
1588  direction = OIS::Pov::North;
1589  if (!strcmp(dir, "South"))
1590  direction = OIS::Pov::South;
1591  if (!strcmp(dir, "East"))
1592  direction = OIS::Pov::East;
1593  if (!strcmp(dir, "West"))
1594  direction = OIS::Pov::West;
1595  if (!strcmp(dir, "NorthEast"))
1596  direction = OIS::Pov::NorthEast;
1597  if (!strcmp(dir, "SouthEast"))
1598  direction = OIS::Pov::SouthEast;
1599  if (!strcmp(dir, "NorthWest"))
1600  direction = OIS::Pov::NorthWest;
1601  if (!strcmp(dir, "SouthWest"))
1602  direction = OIS::Pov::SouthWest;
1603 
1604  event_trigger_t t_pov = newEvent();
1605  t_pov.configDeviceID = deviceID;
1606  t_pov.eventtype = eventtype;
1607  t_pov.joystickNumber = (deviceID == -1 ? joyNo : deviceID);
1608  t_pov.joystickPovNumber = povNumber;
1609  t_pov.joystickPovDirection = direction;
1610 
1611  strncpy(t_pov.group, getEventGroup(eventName).c_str(), 128);
1612  strncpy(t_pov.tmp_eventname, eventName, 128);
1613  strncpy(t_pov.comments, cur_comment.c_str(), 1024);
1614  strncpy(t_pov.configline, dir, 128);
1615  cur_comment = "";
1616  addEvent(eventID, t_pov);
1617  //LOG("added axis: " + TOSTRING(axisNo));
1618  return true;
1619  }
1620  case ET_JoystickSliderX:
1621  case ET_JoystickSliderY:
1622  {
1623  int sliderNumber = 0;
1624  char options[256] = {};
1625  char type;
1626  sscanf(line, "%s %s %d %c %d %s", eventName, evtype, &joyNo, &type, &sliderNumber, options);
1627  int eventID = resolveEventName(String(eventName));
1628  if (eventID == -1)
1629  return false;
1630 
1631  bool reverse = false;
1632  char tmp[256] = {};
1633  strncpy(tmp, options, 255);
1634  tmp[255] = '\0';
1635  char* token = strtok(tmp, delimiters);
1636  while (token != NULL)
1637  {
1638  if (strncmp(token, "REVERSE", 7) == 0)
1639  reverse = true;
1640 
1641  token = strtok(NULL, delimiters);
1642  }
1643 
1644  event_trigger_t t_slider = newEvent();
1645  t_slider.configDeviceID = deviceID;
1646 
1647  if (type == 'Y' || type == 'y')
1648  eventtype = ET_JoystickSliderY;
1649  else if (type == 'X' || type == 'x')
1650  eventtype = ET_JoystickSliderX;
1651 
1652  t_slider.eventtype = eventtype;
1653  t_slider.joystickNumber = (deviceID == -1 ? joyNo : deviceID);
1654  t_slider.joystickSliderNumber = sliderNumber;
1655  t_slider.joystickSliderReverse = reverse;
1656  // TODO: add region support to sliders!
1657  t_slider.joystickSliderRegion = 0;
1658  strncpy(t_slider.configline, options, 128);
1659  strncpy(t_slider.group, getEventGroup(eventName).c_str(), 128);
1660  strncpy(t_slider.tmp_eventname, eventName, 128);
1661  strncpy(t_slider.comments, cur_comment.c_str(), 1024);
1662  cur_comment = "";
1663  addEvent(eventID, t_slider);
1664  //LOG("added axis: " + TOSTRING(axisNo));
1665  return true;
1666  }
1667  default:
1668  return false;
1669  }
1670 }
1671 
1672 int InputEngine::getCurrentJoyButton(int& joystickNumber, int& button)
1673 {
1674  for (int j = 0; j < free_joysticks; j++)
1675  {
1676  for (int i = 0; i < (int)joyState[j].mButtons.size(); i++)
1677  {
1678  if (joyState[j].mButtons[i])
1679  {
1680  joystickNumber = j;
1681  button = i;
1682  return 1;
1683  }
1684  }
1685  }
1686  return 0;
1687 }
1688 
1689 int InputEngine::getCurrentPovValue(int& joystickNumber, int& pov, int& povdir)
1690 {
1691  for (int j = 0; j < free_joysticks; j++)
1692  {
1693  for (int i = 0; i < MAX_JOYSTICK_POVS; i++)
1694  {
1695  if (joyState[j].mPOV[i].direction != Pov::Centered)
1696  {
1697  joystickNumber = j;
1698  pov = i;
1699  povdir = joyState[j].mPOV[i].direction;
1700  return 1;
1701  }
1702  }
1703  }
1704  return 0;
1705 }
1706 
1708 {
1709  OIS::MouseState const& mstate = mMouse->getMouseState();
1710  Ogre::Vector2 res;
1711  res.x = static_cast<float>(mstate.X.abs) / static_cast<float>(mstate.width);
1712  res.y = static_cast<float>(mstate.Y.abs) / static_cast<float>(mstate.height);
1713  return res;
1714 }
1715 
1717 {
1718  event_trigger_t res;
1719  memset(&res, 0, sizeof(event_trigger_t));
1720  return res;
1721 }
1722 
1723 int InputEngine::getJoyComponentCount(OIS::ComponentType type, int joystickNumber)
1724 {
1725  if (joystickNumber > free_joysticks || !mJoy[joystickNumber])
1726  return 0;
1727  return mJoy[joystickNumber]->getNumberOfComponents(type);
1728 }
1729 
1730 std::string InputEngine::getJoyVendor(int joystickNumber)
1731 {
1732  if (joystickNumber > free_joysticks || !mJoy[joystickNumber])
1733  return "unknown";
1734  return mJoy[joystickNumber]->vendor();
1735 }
1736 
1737 JoyStickState* InputEngine::getCurrentJoyState(int joystickNumber)
1738 {
1739  if (joystickNumber > free_joysticks)
1740  return 0;
1741  return &joyState[joystickNumber];
1742 }
1743 
1745 {
1746  std::map<int, bool>::iterator i;
1747  int keyCounter = 0;
1748  int modCounter = 0;
1749 
1750  // list all modificators first
1751  for (i = keyState.begin(); i != keyState.end(); i++)
1752  {
1753  if (i->second)
1754  {
1755  if (i->first != KC_LSHIFT && i->first != KC_RSHIFT && i->first != KC_LCONTROL && i->first != KC_RCONTROL && i->first != KC_LMENU && i->first != KC_RMENU)
1756  continue;
1757  modCounter++;
1758  String keyName = getKeyNameForKeyCode((OIS::KeyCode)i->first);
1759  if (*combo == "")
1760  *combo = keyName;
1761  else
1762  *combo = *combo + "+" + keyName;
1763  }
1764  }
1765 
1766  // now list all keys
1767  for (i = keyState.begin(); i != keyState.end(); i++)
1768  {
1769  if (i->second)
1770  {
1771  if (i->first == KC_LSHIFT || i->first == KC_RSHIFT || i->first == KC_LCONTROL || i->first == KC_RCONTROL || i->first == KC_LMENU || i->first == KC_RMENU)
1772  continue;
1773  String keyName = getKeyNameForKeyCode((OIS::KeyCode)i->first);
1774  if (*combo == "")
1775  *combo = keyName;
1776  else
1777  *combo = *combo + "+" + keyName;
1778  keyCounter++;
1779  }
1780  }
1781 
1782  //
1783  if (modCounter > 0 && keyCounter == 0)
1784  {
1785  return -modCounter;
1786  }
1787  else if (keyCounter == 0 && modCounter == 0)
1788  {
1789  *combo = _L("(Please press a key)");
1790  return 0;
1791  }
1792  return keyCounter;
1793 }
1794 
1795 String InputEngine::getEventGroup(String eventName)
1796 {
1797  const char delimiters[] = "_";
1798  char tmp[256] = {};
1799  strncpy(tmp, eventName.c_str(), 255);
1800  tmp[255] = '\0';
1801  char* token = strtok(tmp, delimiters);
1802  while (token != NULL)
1803  {
1804  return String(token);
1805  }
1806  return "";
1807 }
1808 
1810 {
1812  return false;
1813  bool isSlider = (t->eventtype == ET_JoystickSliderX || t->eventtype == ET_JoystickSliderY);
1814  strcpy(t->configline, "");
1815 
1816  if (isSlider)
1817  {
1818  if (t->joystickSliderReverse && !strlen(t->configline))
1819  strcat(t->configline, "REVERSE");
1820  else if (t->joystickSliderReverse && strlen(t->configline))
1821  strcat(t->configline, "+REVERSE");
1822 
1823  if (t->joystickSliderRegion == 1 && !strlen(t->configline))
1824  strcat(t->configline, "UPPER");
1825  else if (t->joystickSliderRegion == 1 && strlen(t->configline))
1826  strcat(t->configline, "+UPPER");
1827  else if (t->joystickSliderRegion == -1 && !strlen(t->configline))
1828  strcat(t->configline, "LOWER");
1829  else if (t->joystickSliderRegion == -1 && strlen(t->configline))
1830  strcat(t->configline, "+LOWER");
1831 
1832  // is this is a slider, ignore the rest
1833  return true;
1834  }
1835 
1836  if (t->joystickAxisReverse && !strlen(t->configline))
1837  strcat(t->configline, "REVERSE");
1838  else if (t->joystickAxisReverse && strlen(t->configline))
1839  strcat(t->configline, "+REVERSE");
1840 
1841  if (t->joystickAxisRegion == 1 && !strlen(t->configline))
1842  strcat(t->configline, "UPPER");
1843  else if (t->joystickAxisRegion == 1 && strlen(t->configline))
1844  strcat(t->configline, "+UPPER");
1845  else if (t->joystickAxisRegion == -1 && !strlen(t->configline))
1846  strcat(t->configline, "LOWER");
1847  else if (t->joystickAxisRegion == -1 && strlen(t->configline))
1848  strcat(t->configline, "+LOWER");
1849 
1850  if (fabs(t->joystickAxisDeadzone - 0.1) > 0.0001f)
1851  {
1852  char tmp[256] = {};
1853  sprintf(tmp, "DEADZONE=%0.2f", t->joystickAxisDeadzone);
1854  if (strlen(t->configline))
1855  {
1856  strcat(t->configline, "+");
1857  strcat(t->configline, tmp);
1858  }
1859  else
1860  strcat(t->configline, tmp);
1861  }
1862  if (fabs(1.0f - t->joystickAxisLinearity) > 0.01f)
1863  {
1864  char tmp[256] = {};
1865  sprintf(tmp, "LINEARITY=%0.2f", t->joystickAxisLinearity);
1866  if (strlen(t->configline))
1867  {
1868  strcat(t->configline, "+");
1869  strcat(t->configline, tmp);
1870  }
1871  else
1872  strcat(t->configline, tmp);
1873  }
1874  return true;
1875 }
1876 
1878 {
1879  for (int i = 0; i < EV_MODE_LAST; i++)
1880  {
1881  if (events.find(eventInfo[i].eventID) == events.end())
1882  {
1883  // not existing, insert default
1884 
1885  char tmp[256] = "";
1886  sprintf(tmp, "%s %s", eventInfo[i].name.c_str(), eventInfo[i].defaultKey.c_str());
1887 
1889  }
1890  }
1891 }
1892 
1893 // Loads config file specific to a device and OS (or default config if deviceID is -1).
1895 {
1896  String fileName;
1897  if (deviceID == -1)
1898  {
1899  fileName = DEFAULT_MAPFILE;
1900  }
1901  else
1902  {
1903  ROR_ASSERT(deviceID < free_joysticks);
1904 
1905  String deviceStr = mJoy[deviceID]->vendor();
1906 
1907  // care about unsuitable chars
1908  String repl = "\\/ #@?!$%^&*()+=-><.:'|\";";
1909  for (unsigned int c = 0; c < repl.size(); c++)
1910  {
1911  deviceStr = StringUtil::replaceAll(deviceStr, repl.substr(c, 1), "_");
1912  }
1913 
1914  // Look for OS-specific device mapping
1915  String osSpecificMapFile;
1916 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
1917  osSpecificMapFile = deviceStr + ".windows.map";
1918 #elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
1919  osSpecificMapFile = deviceStr + ".linux.map";
1920 #endif
1921  if (osSpecificMapFile != "" &&
1922  ResourceGroupManager::getSingleton().resourceExists(RGN_CONFIG, osSpecificMapFile))
1923  {
1924  fileName = osSpecificMapFile;
1925  }
1926  else
1927  {
1928  // Load generic device mapping
1929  fileName = deviceStr + ".map";
1930  }
1931 
1932  m_loaded_configs[deviceID] = fileName;
1933  }
1934 
1935  return this->loadMapping(fileName, deviceID);
1936 }
1937 
1939 {
1940  ROR_ASSERT(deviceID < free_joysticks);
1941 
1942  if (deviceID == -1)
1943  return this->saveMapping(DEFAULT_MAPFILE, deviceID);
1944  else
1945  return this->saveMapping(m_loaded_configs[deviceID], deviceID);
1946 }
1947 
1948 std::string const& InputEngine::getLoadedConfigFile(int deviceID /*= -1*/)
1949 {
1950  ROR_ASSERT(deviceID < free_joysticks);
1951  if (deviceID == -1)
1952  return DEFAULT_MAPFILE;
1953  else
1954  return m_loaded_configs[deviceID];
1955 }
1956 
1957 bool InputEngine::loadMapping(String fileName, int deviceID)
1958 {
1959  char line[1025] = "";
1960  int oldState = uniqueCounter;
1961 
1962  LOG(" * Loading input mapping " + fileName);
1963  {
1964  DataStreamPtr ds;
1965  try
1966  {
1967  ds = ResourceGroupManager::getSingleton().openResource(fileName, RGN_CONFIG);
1968  }
1969  catch (...)
1970  {
1971  return false;
1972  }
1973  while (!ds->eof())
1974  {
1975  size_t size = 1024;
1976  if (ds->tell() + size >= ds->size())
1977  size = ds->size() - ds->tell();
1978  if (ds->tell() >= ds->size())
1979  break;
1980  size_t readnum = ds->readLine(line, size);
1981  if (readnum > 5)
1982  processLine(line, deviceID);
1983  }
1984  }
1985 
1986  int newEvents = uniqueCounter - oldState;
1987  LOG(" * Input map successfully loaded: " + TOSTRING(newEvents) + " entries");
1988  return true;
1989 }
1990 
1991 bool InputEngine::saveMapping(String fileName, int deviceID)
1992 {
1993  const int COL1_WIDTH = 34; // total 35
1994  const int COL2_WIDTH = 19; // total 20
1995 
1996  try
1997  {
1998  // Open file for writing (overwrite existing).
1999  Ogre::DataStreamPtr ds = Ogre::ResourceGroupManager::getSingleton().createResource(
2000  fileName, RGN_CONFIG, /*overwrite:*/true);
2001 
2002  // Loop events and filter by device.
2003  for (auto& ev_pair: events)
2004  {
2005  for (event_trigger_t& ev: ev_pair.second)
2006  {
2007  if (ev.configDeviceID == deviceID)
2008  {
2009  // We found a matching event - compose config line and write it.
2010 
2011  string conf_string = this->composeEventConfigString(ev);
2012  switch (ev.eventtype)
2013  {
2014  case ET_JoystickButton:
2015  case ET_JoystickAxisAbs:
2016  case ET_JoystickAxisRel:
2017  case ET_JoystickPov:
2018  case ET_JoystickSliderX:
2019  case ET_JoystickSliderY:
2020  conf_string = fmt::format("0 {}", conf_string); // Dummy device number (unused)
2021  break;
2022  default:;
2023  }
2024 
2025  std::string line = fmt::format("{:<{}} {:<{}} {}\n", // padding: ("{:<{}}", "abc", 10) writes "abc "
2026  this->eventIDToName(ev_pair.first), COL1_WIDTH,
2027  this->getEventTypeName(ev.eventtype), COL2_WIDTH,
2028  conf_string);
2029  ds->write(line.c_str(), line.size());
2030  }
2031  }
2032  }
2033  return true; // Closes `ds`
2034  }
2035  catch (Ogre::Exception& e) // Already logged by OGRE
2036  {
2038  fmt::format("Failed to write '{}', {}", fileName, e.getDescription()));
2039  return false;
2040  }
2041 }
2042 
2043 int InputEngine::resolveEventName(String eventName)
2044 {
2045  int i = 0;
2046  while (i != EV_MODE_LAST)
2047  {
2048  if (eventInfo[i].name == eventName)
2049  return eventInfo[i].eventID;
2050  i++;
2051  }
2052  LOG("unknown event (ignored): " + eventName);
2053  return -1;
2054 }
2055 
2056 String InputEngine::eventIDToName(int eventID)
2057 {
2058  int i = 0;
2059  while (i != EV_MODE_LAST)
2060  {
2061  if (eventInfo[i].eventID == eventID)
2062  return eventInfo[i].name;
2063  i++;
2064  }
2065  return "unknown";
2066 }
2067 
2069 {
2070  int i = 0;
2071  while (i != EV_MODE_LAST)
2072  {
2073  if (eventInfo[i].eventID == eventID)
2074  return eventInfo[i].description;
2075  i++;
2076  }
2077  return "unknown";
2078 }
2079 
2081 {
2082  allkeys["0"] = KC_0;
2083  allkeys["1"] = KC_1;
2084  allkeys["2"] = KC_2;
2085  allkeys["3"] = KC_3;
2086  allkeys["4"] = KC_4;
2087  allkeys["5"] = KC_5;
2088  allkeys["6"] = KC_6;
2089  allkeys["7"] = KC_7;
2090  allkeys["8"] = KC_8;
2091  allkeys["9"] = KC_9;
2092  allkeys["A"] = KC_A;
2093  allkeys["ABNT_C1"] = KC_ABNT_C1;
2094  allkeys["ABNT_C2"] = KC_ABNT_C2;
2095  allkeys["ADD"] = KC_ADD;
2096  allkeys["APOSTROPHE"] = KC_APOSTROPHE;
2097  allkeys["APPS"] = KC_APPS;
2098  allkeys["AT"] = KC_AT;
2099  allkeys["AX"] = KC_AX;
2100  allkeys["B"] = KC_B;
2101  allkeys["BACK"] = KC_BACK;
2102  allkeys["BACKSLASH"] = KC_BACKSLASH;
2103  allkeys["C"] = KC_C;
2104  allkeys["CALCULATOR"] = KC_CALCULATOR;
2105  allkeys["CAPITAL"] = KC_CAPITAL;
2106  allkeys["COLON"] = KC_COLON;
2107  allkeys["COMMA"] = KC_COMMA;
2108  allkeys["CONVERT"] = KC_CONVERT;
2109  allkeys["D"] = KC_D;
2110  allkeys["DECIMAL"] = KC_DECIMAL;
2111  allkeys["DELETE"] = KC_DELETE;
2112  allkeys["DIVIDE"] = KC_DIVIDE;
2113  allkeys["DOWN"] = KC_DOWN;
2114  allkeys["E"] = KC_E;
2115  allkeys["END"] = KC_END;
2116  allkeys["EQUALS"] = KC_EQUALS;
2117  allkeys["ESCAPE"] = KC_ESCAPE;
2118  allkeys["F"] = KC_F;
2119  allkeys["F1"] = KC_F1;
2120  allkeys["F10"] = KC_F10;
2121  allkeys["F11"] = KC_F11;
2122  allkeys["F12"] = KC_F12;
2123  allkeys["F13"] = KC_F13;
2124  allkeys["F14"] = KC_F14;
2125  allkeys["F15"] = KC_F15;
2126  allkeys["F2"] = KC_F2;
2127  allkeys["F3"] = KC_F3;
2128  allkeys["F4"] = KC_F4;
2129  allkeys["F5"] = KC_F5;
2130  allkeys["F6"] = KC_F6;
2131  allkeys["F7"] = KC_F7;
2132  allkeys["F8"] = KC_F8;
2133  allkeys["F9"] = KC_F9;
2134  allkeys["G"] = KC_G;
2135  allkeys["GRAVE"] = KC_GRAVE;
2136  allkeys["H"] = KC_H;
2137  allkeys["HOME"] = KC_HOME;
2138  allkeys["I"] = KC_I;
2139  allkeys["INSERT"] = KC_INSERT;
2140  allkeys["J"] = KC_J;
2141  allkeys["K"] = KC_K;
2142  allkeys["KANA"] = KC_KANA;
2143  allkeys["KANJI"] = KC_KANJI;
2144  allkeys["L"] = KC_L;
2145  allkeys["LBRACKET"] = KC_LBRACKET;
2146  allkeys["LCONTROL"] = KC_LCONTROL;
2147  allkeys["LEFT"] = KC_LEFT;
2148  allkeys["LMENU"] = KC_LMENU;
2149  allkeys["LSHIFT"] = KC_LSHIFT;
2150  allkeys["LWIN"] = KC_LWIN;
2151  allkeys["M"] = KC_M;
2152  allkeys["MAIL"] = KC_MAIL;
2153  allkeys["MEDIASELECT"] = KC_MEDIASELECT;
2154  allkeys["MEDIASTOP"] = KC_MEDIASTOP;
2155  allkeys["MINUS"] = KC_MINUS;
2156  allkeys["MULTIPLY"] = KC_MULTIPLY;
2157  allkeys["MUTE"] = KC_MUTE;
2158  allkeys["MYCOMPUTER"] = KC_MYCOMPUTER;
2159  allkeys["N"] = KC_N;
2160  allkeys["NEXTTRACK"] = KC_NEXTTRACK;
2161  allkeys["NOCONVERT"] = KC_NOCONVERT;
2162  allkeys["NUMLOCK"] = KC_NUMLOCK;
2163  allkeys["NUMPAD0"] = KC_NUMPAD0;
2164  allkeys["NUMPAD1"] = KC_NUMPAD1;
2165  allkeys["NUMPAD2"] = KC_NUMPAD2;
2166  allkeys["NUMPAD3"] = KC_NUMPAD3;
2167  allkeys["NUMPAD4"] = KC_NUMPAD4;
2168  allkeys["NUMPAD5"] = KC_NUMPAD5;
2169  allkeys["NUMPAD6"] = KC_NUMPAD6;
2170  allkeys["NUMPAD7"] = KC_NUMPAD7;
2171  allkeys["NUMPAD8"] = KC_NUMPAD8;
2172  allkeys["NUMPAD9"] = KC_NUMPAD9;
2173  allkeys["NUMPADCOMMA"] = KC_NUMPADCOMMA;
2174  allkeys["NUMPADENTER"] = KC_NUMPADENTER;
2175  allkeys["NUMPADEQUALS"] = KC_NUMPADEQUALS;
2176  allkeys["O"] = KC_O;
2177  allkeys["OEM_102"] = KC_OEM_102;
2178  allkeys["P"] = KC_P;
2179  allkeys["PAUSE"] = KC_PAUSE;
2180  allkeys["PERIOD"] = KC_PERIOD;
2181  allkeys["PGDOWN"] = KC_PGDOWN;
2182  allkeys["PGUP"] = KC_PGUP;
2183  allkeys["PLAYPAUSE"] = KC_PLAYPAUSE;
2184  allkeys["POWER"] = KC_POWER;
2185  allkeys["PREVTRACK"] = KC_PREVTRACK;
2186  allkeys["Q"] = KC_Q;
2187  allkeys["R"] = KC_R;
2188  allkeys["RBRACKET"] = KC_RBRACKET;
2189  allkeys["RCONTROL"] = KC_RCONTROL;
2190  allkeys["RETURN"] = KC_RETURN;
2191  allkeys["RIGHT"] = KC_RIGHT;
2192  allkeys["RMENU"] = KC_RMENU;
2193  allkeys["RSHIFT"] = KC_RSHIFT;
2194  allkeys["RWIN"] = KC_RWIN;
2195  allkeys["S"] = KC_S;
2196  allkeys["SCROLL"] = KC_SCROLL;
2197  allkeys["SEMICOLON"] = KC_SEMICOLON;
2198  allkeys["SLASH"] = KC_SLASH;
2199  allkeys["SLEEP"] = KC_SLEEP;
2200  allkeys["SPACE"] = KC_SPACE;
2201  allkeys["STOP"] = KC_STOP;
2202  allkeys["SUBTRACT"] = KC_SUBTRACT;
2203  allkeys["SYSRQ"] = KC_SYSRQ;
2204  allkeys["T"] = KC_T;
2205  allkeys["TAB"] = KC_TAB;
2206  allkeys["U"] = KC_U;
2207  allkeys["UNDERLINE"] = KC_UNDERLINE;
2208  allkeys["UNLABELED"] = KC_UNLABELED;
2209  allkeys["UP"] = KC_UP;
2210  allkeys["V"] = KC_V;
2211  allkeys["VOLUMEDOWN"] = KC_VOLUMEDOWN;
2212  allkeys["VOLUMEUP"] = KC_VOLUMEUP;
2213  allkeys["W"] = KC_W;
2214  allkeys["WAKE"] = KC_WAKE;
2215  allkeys["WEBBACK"] = KC_WEBBACK;
2216  allkeys["WEBFAVORITES"] = KC_WEBFAVORITES;
2217  allkeys["WEBFORWARD"] = KC_WEBFORWARD;
2218  allkeys["WEBHOME"] = KC_WEBHOME;
2219  allkeys["WEBREFRESH"] = KC_WEBREFRESH;
2220  allkeys["WEBSEARCH"] = KC_WEBSEARCH;
2221  allkeys["WEBSTOP"] = KC_WEBSTOP;
2222  allkeys["X"] = KC_X;
2223  allkeys["Y"] = KC_Y;
2224  allkeys["YEN"] = KC_YEN;
2225  allkeys["Z"] = KC_Z;
2226 }
2227 
2229 {
2230  std::map<int, std::vector<event_trigger_t>>::iterator it = events.find(eventID);
2231 
2232  if (it == events.end())
2233  return String();
2234  if (it->second.empty())
2235  return String();
2236 
2237  std::vector<event_trigger_t>::iterator it2 = it->second.begin();
2238  return getKeyNameForKeyCode((OIS::KeyCode)it2->keyCode);
2239 }
2240 
2241 Ogre::String InputEngine::getModifierKeyName(OIS::KeyCode key)
2242 {
2243  switch (key)
2244  {
2245  case OIS::KC_LMENU: return _LC("ModifierKey", "Left Alt");
2246  case OIS::KC_LSHIFT: return _LC("ModifierKey", "Left Shift");
2247  case OIS::KC_LCONTROL: return _LC("ModifierKey", "Left Ctrl");
2248 
2249  case OIS::KC_RMENU: return _LC("ModifierKey", "Right Alt");
2250  case OIS::KC_RSHIFT: return _LC("ModifierKey", "Right Shift");
2251  case OIS::KC_RCONTROL: return _LC("ModifierKey", "Right Ctrl");
2252 
2253  default: return "";
2254  }
2255 }
Script2Game::KC_SUBTRACT
enum Script2Game::inputEvents KC_SUBTRACT
ROR_ASSERT
#define ROR_ASSERT(_EXPR)
Definition: Application.h:40
Script2Game::KC_4
enum Script2Game::inputEvents KC_4
Script2Game::KC_NUMPAD1
enum Script2Game::inputEvents KC_NUMPAD1
RoR::EV_COMMON_SCREENSHOT
@ EV_COMMON_SCREENSHOT
take a screenshot
Definition: InputEngine.h:261
RoR::EV_AIRPLANE_RUDDER_RIGHT
@ EV_AIRPLANE_RUDDER_RIGHT
rudder right
Definition: InputEngine.h:91
RoR::InputEngine::BUILTIN_MAPPING_DEVICEID
static const int BUILTIN_MAPPING_DEVICEID
virtual device ID for builtin defaults
Definition: InputEngine.h:466
RoR::EV_COMMANDS_83
@ EV_COMMANDS_83
Command 83.
Definition: InputEngine.h:221
RoR::InputEngine::~InputEngine
~InputEngine()
Definition: InputEngine.cpp:434
RoR::EV_COMMANDS_08
@ EV_COMMANDS_08
Command 8.
Definition: InputEngine.h:146
RoR::InputEngine::processLine
bool processLine(const char *line, int deviceID=-1)
Definition: InputEngine.cpp:1332
RoR::EV_AIRPLANE_THROTTLE
@ EV_AIRPLANE_THROTTLE
Definition: InputEngine.h:94
RoR::EV_COMMANDS_72
@ EV_COMMANDS_72
Command 72.
Definition: InputEngine.h:210
RoR::InputEngine::clearAllEvents
void clearAllEvents()
Purges all configured bindings.
Definition: InputEngine.cpp:1326
RoR::EV_SURVEY_MAP_CYCLE
@ EV_SURVEY_MAP_CYCLE
cycle overview-map mode
Definition: InputEngine.h:292
RoR::InputEngine::initAllKeys
void initAllKeys()
Definition: InputEngine.cpp:2080
RoR::InputEngine::m_oisworkaround_frames_since_reset
size_t m_oisworkaround_frames_since_reset
Definition: InputEngine.h:617
RoR::InputEngine::setEventStatusSupressed
void setEventStatusSupressed(events eventID, bool supress)
Definition: InputEngine.cpp:752
RoR::EV_CAMERA_ZOOM_OUT_FAST
@ EV_CAMERA_ZOOM_OUT_FAST
zoom camera out faster
Definition: InputEngine.h:128
mOISDeviceType
const char * mOISDeviceType[6]
Definition: InputEngine.cpp:35
RoR::EV_COMMON_REPLAY_FORWARD
@ EV_COMMON_REPLAY_FORWARD
Definition: InputEngine.h:255
RoR::InputEngine::getEventCommandTrimmed
std::string getEventCommandTrimmed(int eventID)
Omits 'EXPL' modifier.
Definition: InputEngine.cpp:831
RoR::EV_COMMANDS_66
@ EV_COMMANDS_66
Command 66.
Definition: InputEngine.h:204
RoR::EV_COMMANDS_06
@ EV_COMMANDS_06
Command 6.
Definition: InputEngine.h:144
RoR::InputEngine::getEventTypeName
static const char * getEventTypeName(eventtypes type)
Enum to string helper.
Definition: InputEngine.cpp:1220
RoR::EV_SURVEY_MAP_TOGGLE
@ EV_SURVEY_MAP_TOGGLE
toggle overview-map mode
Definition: InputEngine.h:293
Script2Game::KC_INSERT
enum Script2Game::inputEvents KC_INSERT
RoR::EV_AIRPLANE_THROTTLE_DOWN
@ EV_AIRPLANE_THROTTLE_DOWN
decreases the airplane thrust
Definition: InputEngine.h:96
RoR::EV_COMMANDS_37
@ EV_COMMANDS_37
Command 37.
Definition: InputEngine.h:175
Script2Game::KC_1
enum Script2Game::inputEvents KC_1
RoR::EV_GRASS_MORE
@ EV_GRASS_MORE
EXPERIMENTAL: add some grass.
Definition: InputEngine.h:282
RGN_CONFIG
#define RGN_CONFIG
Definition: Application.h:48
RoR::InputEngine::processMouseReleaseEvent
void processMouseReleaseEvent(const OIS::MouseEvent &arg, OIS::MouseButtonID _id)
Definition: InputEngine.cpp:721
RoR::InputEngine::getCurrentKeyCombo
int getCurrentKeyCombo(Ogre::String *combo)
Returns number of non-modifier keys pressed (or modifier count as negative number).
Definition: InputEngine.cpp:1744
Script2Game::KC_HOME
enum Script2Game::inputEvents KC_HOME
RoR::EV_TRUCK_BRAKE_MODIFIER_50
@ EV_TRUCK_BRAKE_MODIFIER_50
brake with 50 percent pedal input
Definition: InputEngine.h:308
Script2Game::KC_LBRACKET
enum Script2Game::inputEvents KC_LBRACKET
RoR::event_trigger_t::ctrl
bool ctrl
Definition: InputEngine.h:424
Script2Game::KC_PAUSE
enum Script2Game::inputEvents KC_PAUSE
RoR::EV_TRUCK_SHIFT_UP
@ EV_TRUCK_SHIFT_UP
shift one gear up in manual transmission mode
Definition: InputEngine.h:355
RoR::EV_COMMANDS_60
@ EV_COMMANDS_60
Command 50.
Definition: InputEngine.h:198
RoR::EV_COMMANDS_58
@ EV_COMMANDS_58
Command 58.
Definition: InputEngine.h:196
Script2Game::KC_NUMPAD7
enum Script2Game::inputEvents KC_NUMPAD7
RoR::EV_COMMANDS_40
@ EV_COMMANDS_40
Command 40.
Definition: InputEngine.h:178
RoR::EV_COMMON_RESET_TRUCK
@ EV_COMMON_RESET_TRUCK
reset truck to original starting position
Definition: InputEngine.h:257
RoR::EV_COMMON_QUICKLOAD_10
@ EV_COMMON_QUICKLOAD_10
Definition: InputEngine.h:392
RoR::EV_COMMON_REPAIR_TRUCK
@ EV_COMMON_REPAIR_TRUCK
repair truck to original condition
Definition: InputEngine.h:250
RoR::EV_COMMON_CONSOLE_TOGGLE
@ EV_COMMON_CONSOLE_TOGGLE
show / hide the console
Definition: InputEngine.h:227
RoR::EV_COMMANDS_53
@ EV_COMMANDS_53
Command 53.
Definition: InputEngine.h:191
RoR::EV_TRUCK_TOGGLE_CONTACT
@ EV_TRUCK_TOGGLE_CONTACT
toggle ignition
Definition: InputEngine.h:360
RoR::EV_COMMON_TOGGLE_PHYSICS
@ EV_COMMON_TOGGLE_PHYSICS
toggle physics on/off
Definition: InputEngine.h:271
RoR::EV_TRUCK_RIGHT_MIRROR_RIGHT
@ EV_TRUCK_RIGHT_MIRROR_RIGHT
Definition: InputEngine.h:330
RoR::InputEvent::eventID
int eventID
Definition: InputEngine.h:411
RoR::InputEngine::free_joysticks
int free_joysticks
Number of detected game controllers.
Definition: InputEngine.h:579
RoR::InputEngine::updateKeyBounces
void updateKeyBounces(float dt)
Definition: InputEngine.cpp:780
RoR::InputSourceType::IST_ANALOG
@ IST_ANALOG
RoR::InputEngine::getDeviceName
Ogre::String getDeviceName(event_trigger_t const &evt)
Definition: InputEngine.cpp:1195
RoR::EV_TRUCK_LIGHTTOGGLE06
@ EV_TRUCK_LIGHTTOGGLE06
toggle custom light 6
Definition: InputEngine.h:321
RoR::event_trigger_t::joystickAxisReverse
bool joystickAxisReverse
Definition: InputEngine.h:437
RoR::InputEngine::m_oisworkaround_lmbdowns_since_reset
size_t m_oisworkaround_lmbdowns_since_reset
Definition: InputEngine.h:618
RoR::InputSourceType::IST_ANY
@ IST_ANY
RoR::InputEngine::loadConfigFile
bool loadConfigFile(int deviceID=-1)
Loads config file specific to a device and OS (or default config if deviceID is -1).
Definition: InputEngine.cpp:1894
RoR::InputEngine::saveMapping
bool saveMapping(Ogre::String fileName, int deviceID)
Definition: InputEngine.cpp:1991
RoR::EV_COMMON_TOGGLE_TRUCK_BEACONS
@ EV_COMMON_TOGGLE_TRUCK_BEACONS
toggle truck beacons
Definition: InputEngine.h:273
RoR::EV_TRUCK_RIGHT_MIRROR_LEFT
@ EV_TRUCK_RIGHT_MIRROR_LEFT
Definition: InputEngine.h:329
RoR::EV_TRUCK_BLINK_RIGHT
@ EV_TRUCK_BLINK_RIGHT
toggle right direction indicator (blinker)
Definition: InputEngine.h:304
RoR::EV_COMMANDS_26
@ EV_COMMANDS_26
Command 26.
Definition: InputEngine.h:164
Script2Game::KC_NUMPAD4
enum Script2Game::inputEvents KC_NUMPAD4
RoR::EV_COMMANDS_32
@ EV_COMMANDS_32
Command 32.
Definition: InputEngine.h:170
RoR::EV_COMMON_ENTER_OR_EXIT_TRUCK
@ EV_COMMON_ENTER_OR_EXIT_TRUCK
enter or exit a truck
Definition: InputEngine.h:229
RoR::EV_COMMANDS_54
@ EV_COMMANDS_54
Command 54.
Definition: InputEngine.h:192
RoR::EV_BOAT_STEER_LEFT_AXIS
@ EV_BOAT_STEER_LEFT_AXIS
steer left (analog value!)
Definition: InputEngine.h:104
Script2Game::KC_PGDOWN
enum Script2Game::inputEvents KC_PGDOWN
RoR::InputEngine::saveConfigFile
bool saveConfigFile(int deviceID=-1)
Wites events with matching deviceID to loaded file with matching deviceID (or default file if deviceI...
Definition: InputEngine.cpp:1938
Script2Game::KC_MINUS
enum Script2Game::inputEvents KC_MINUS
RoR::EV_CAMERA_ROTATE_UP
@ EV_CAMERA_ROTATE_UP
rotate camera up
Definition: InputEngine.h:123
RoR::EV_COMMON_TOGGLE_RESET_MODE
@ EV_COMMON_TOGGLE_RESET_MODE
toggle truck reset truck mode (soft vs. hard)
Definition: InputEngine.h:258
RoR::EV_COMMANDS_61
@ EV_COMMANDS_61
Command 61.
Definition: InputEngine.h:199
RoR::event_trigger_t::joystickAxisHalf
bool joystickAxisHalf
Definition: InputEngine.h:438
Script2Game::KC_DELETE
enum Script2Game::inputEvents KC_DELETE
RoR::EV_COMMON_TOGGLE_TRUCK_FOG_LIGHTS
@ EV_COMMON_TOGGLE_TRUCK_FOG_LIGHTS
toggle truck fog lights (on/off); doesn't need low beams, doesn't use 't' lights.
Definition: InputEngine.h:277
Script2Game::KC_NUMPAD9
enum Script2Game::inputEvents KC_NUMPAD9
RoR::InputEngine::getEventConfig
Ogre::String getEventConfig(int eventID)
Definition: InputEngine.cpp:842
Script2Game::KC_6
enum Script2Game::inputEvents KC_6
Script2Game::KC_PGUP
enum Script2Game::inputEvents KC_PGUP
ContentManager.h
RoR::AppContext::GetRenderWindow
Ogre::RenderWindow * GetRenderWindow()
Definition: AppContext.h:67
RoR::InputEngine::setup
void setup()
Definition: InputEngine.cpp:470
RoR::InputEngine::getMouseState
OIS::MouseState getMouseState()
Definition: InputEngine.cpp:603
Script2Game::KC_GRAVE
enum Script2Game::inputEvents KC_GRAVE
RoR::EV_COMMANDS_03
@ EV_COMMANDS_03
Command 3.
Definition: InputEngine.h:141
RoR::InputEngine::clearEventsByDevice
void clearEventsByDevice(int deviceID)
Clears all bindings with given deviceID (-1 is no exception).
Definition: InputEngine.cpp:1308
RoR::App::GetAppContext
AppContext * GetAppContext()
Definition: Application.cpp:266
Script2Game::KC_F10
enum Script2Game::inputEvents KC_F10
RoR::EV_MENU_UP
@ EV_MENU_UP
select previous element in current category
Definition: InputEngine.h:290
format
Truck file format(technical spec)
RoR::EV_CAMERA_ZOOM_IN
@ EV_CAMERA_ZOOM_IN
zoom camera in
Definition: InputEngine.h:125
RoR::InputEngine::joyState
OIS::JoyStickState joyState[MAX_JOYSTICKS]
Definition: InputEngine.h:585
RoR::InputEvent::defaultKey
Ogre::String defaultKey
Definition: InputEngine.h:412
RoR::EV_CHARACTER_ROT_DOWN
@ EV_CHARACTER_ROT_DOWN
Definition: InputEngine.h:134
RoR::EV_COMMANDS_69
@ EV_COMMANDS_69
Command 69.
Definition: InputEngine.h:207
RoR::InputEngine::newEvent
event_trigger_t newEvent()
Definition: InputEngine.cpp:1716
RoR::EV_COMMON_AUTOLOCK
@ EV_COMMON_AUTOLOCK
unlock autolock hook node
Definition: InputEngine.h:226
RoR::EV_TRUCK_SHIFT_GEAR09
@ EV_TRUCK_SHIFT_GEAR09
shift directly into this gear
Definition: InputEngine.h:340
RoR::EV_TRUCK_BLINK_WARN
@ EV_TRUCK_BLINK_WARN
toggle all direction indicators
Definition: InputEngine.h:305
RoR::event_trigger_t::joystickPovDirection
int joystickPovDirection
Definition: InputEngine.h:443
RoR::EV_TRUCK_SHIFT_GEAR04
@ EV_TRUCK_SHIFT_GEAR04
shift directly into this gear
Definition: InputEngine.h:335
RoR::EV_AIRPLANE_AIRBRAKES_NONE
@ EV_AIRPLANE_AIRBRAKES_NONE
Definition: InputEngine.h:80
RoR::EV_COMMANDS_45
@ EV_COMMANDS_45
Command 45.
Definition: InputEngine.h:183
RoR::EV_TRUCK_SHIFT_GEAR01
@ EV_TRUCK_SHIFT_GEAR01
shift directly into this gear
Definition: InputEngine.h:332
RoR::ET_JoystickSliderX
@ ET_JoystickSliderX
Definition: InputEngine.h:62
RoR::event_trigger_t::eventtype
enum eventtypes eventtype
Definition: InputEngine.h:419
RoR::EV_TRUCK_LIGHTTOGGLE04
@ EV_TRUCK_LIGHTTOGGLE04
toggle custom light 4
Definition: InputEngine.h:319
Script2Game::KC_F8
enum Script2Game::inputEvents KC_F8
RoR::EV_COMMON_ENTER_PREVIOUS_TRUCK
@ EV_COMMON_ENTER_PREVIOUS_TRUCK
enter previous truck
Definition: InputEngine.h:231
RoR::ET_JoystickPov
@ ET_JoystickPov
Definition: InputEngine.h:61
RoR::EV_TRUCK_CRUISE_CONTROL_READJUST
@ EV_TRUCK_CRUISE_CONTROL_READJUST
match target speed / rpm with current truck speed / rpm
Definition: InputEngine.h:312
Script2Game::KC_RETURN
enum Script2Game::inputEvents KC_RETURN
RoR::EV_COMMON_QUICKLOAD_01
@ EV_COMMON_QUICKLOAD_01
Definition: InputEngine.h:383
Script2Game::KC_EQUALS
enum Script2Game::inputEvents KC_EQUALS
RoR::InputEngine::TriggerVec
std::vector< event_trigger_t > TriggerVec
Definition: InputEngine.h:461
RoR::InputEngine::getKeyForCommand
Ogre::String getKeyForCommand(int eventID)
Definition: InputEngine.cpp:2228
RoR::ET_MouseAxisX
@ ET_MouseAxisX
Definition: InputEngine.h:55
RoR::EV_COMMANDS_02
@ EV_COMMANDS_02
Command 2.
Definition: InputEngine.h:140
RoR::InputEngine::SetJoystickListener
void SetJoystickListener(OIS::JoyStickListener *obj)
Definition: InputEngine.cpp:667
RoR::EV_CHARACTER_BACKWARDS
@ EV_CHARACTER_BACKWARDS
step backwards with the character
Definition: InputEngine.h:129
RoR::EV_TRUCK_CRUISE_CONTROL
@ EV_TRUCK_CRUISE_CONTROL
toggle cruise control
Definition: InputEngine.h:309
RoR::EV_TRUCK_SHIFT_GEAR12
@ EV_TRUCK_SHIFT_GEAR12
shift directly into this gear
Definition: InputEngine.h:343
RoR::event_trigger_t::joystickAxisLinearity
float joystickAxisLinearity
Definition: InputEngine.h:435
RoR::InputEngine::axisLinearity
float axisLinearity(float axisValue, float linearity)
Definition: InputEngine.cpp:806
RoR::EV_COMMANDS_17
@ EV_COMMANDS_17
Command 17.
Definition: InputEngine.h:155
RoR::EV_COMMON_LIVE_REPAIR_MODE
@ EV_COMMON_LIVE_REPAIR_MODE
toggles live repair and recovery mode, controlled by keyboard
Definition: InputEngine.h:251
RoR::EV_COMMON_HIDE_GUI
@ EV_COMMON_HIDE_GUI
hide all GUI elements
Definition: InputEngine.h:238
RoR::EV_COMMANDS_09
@ EV_COMMANDS_09
Command 9.
Definition: InputEngine.h:147
Script2Game::KC_RIGHT
enum Script2Game::inputEvents KC_RIGHT
AppContext.h
System integration layer; inspired by OgreBites::ApplicationContext.
RoR::EV_COMMANDS_79
@ EV_COMMANDS_79
Command 79.
Definition: InputEngine.h:217
RoR::EV_COMMON_QUICKSAVE_07
@ EV_COMMON_QUICKSAVE_07
Definition: InputEngine.h:378
Console.h
RoR::Console::putMessage
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
Definition: Console.cpp:97
RoR::InputEngine::event_times
std::map< int, float > event_times
Definition: InputEngine.h:591
RoR::EV_SURVEY_MAP_ZOOM_IN
@ EV_SURVEY_MAP_ZOOM_IN
increase survey map scale
Definition: InputEngine.h:294
RoR::EV_COMMON_GET_NEW_VEHICLE
@ EV_COMMON_GET_NEW_VEHICLE
get new vehicle
Definition: InputEngine.h:244
RoR::EV_COMMANDS_50
@ EV_COMMANDS_50
Command 50.
Definition: InputEngine.h:188
RoR::EV_TRUCK_TOGGLE_FORWARDCOMMANDS
@ EV_TRUCK_TOGGLE_FORWARDCOMMANDS
toggle forwardcommands
Definition: InputEngine.h:361
RoR::EV_TRUCK_TRACTION_CONTROL
@ EV_TRUCK_TRACTION_CONTROL
toggle antilockbrake system
Definition: InputEngine.h:369
RoR::EV_COMMANDS_18
@ EV_COMMANDS_18
Command 18.
Definition: InputEngine.h:156
Script2Game::KC_ESCAPE
enum Script2Game::inputEvents KC_ESCAPE
RoR::EV_BOAT_THROTTLE_DOWN
@ EV_BOAT_THROTTLE_DOWN
decrease throttle
Definition: InputEngine.h:108
RoR::EV_TRUCK_SHIFT_GEAR06
@ EV_TRUCK_SHIFT_GEAR06
shift directly into this gear
Definition: InputEngine.h:337
RoR::EV_TRUCK_SHIFT_DOWN
@ EV_TRUCK_SHIFT_DOWN
shift one gear down in manual transmission mode
Definition: InputEngine.h:331
RoR::EV_COMMANDS_41
@ EV_COMMANDS_41
Command 41.
Definition: InputEngine.h:179
RoR::EV_TRUCK_BRAKE_MODIFIER_25
@ EV_TRUCK_BRAKE_MODIFIER_25
brake with 25 percent pedal input
Definition: InputEngine.h:307
RoR::event_trigger_t::alt
bool alt
Definition: InputEngine.h:426
RoR::EV_MENU_RIGHT
@ EV_MENU_RIGHT
select next category
Definition: InputEngine.h:288
RoR::EV_GRASS_MOST
@ EV_GRASS_MOST
EXPERIMENTAL: set maximum amount of grass.
Definition: InputEngine.h:283
RoR::EV_TRUCK_LIGHTTOGGLE05
@ EV_TRUCK_LIGHTTOGGLE05
toggle custom light 5
Definition: InputEngine.h:320
RoR::EV_COMMON_ENTER_NEXT_TRUCK
@ EV_COMMON_ENTER_NEXT_TRUCK
enter next truck
Definition: InputEngine.h:230
RoR::EV_ROAD_EDITOR_REBUILD_MESH
@ EV_ROAD_EDITOR_REBUILD_MESH
Definition: InputEngine.h:400
RoR::ET_Keyboard
@ ET_Keyboard
Definition: InputEngine.h:53
RoR::EV_COMMON_FOV_LESS
@ EV_COMMON_FOV_LESS
decreases the current FOV value
Definition: InputEngine.h:234
RoR::EV_MENU_DOWN
@ EV_MENU_DOWN
select next element in current category
Definition: InputEngine.h:286
RoR::EV_COMMON_PRESSURE_MORE
@ EV_COMMON_PRESSURE_MORE
increase tire pressure (note: only very few trucks support this)
Definition: InputEngine.h:246
RoR::EV_TRUCK_SHIFT_GEAR13
@ EV_TRUCK_SHIFT_GEAR13
shift directly into this gear
Definition: InputEngine.h:344
RoR::EV_COMMON_SCREENSHOT_BIG
@ EV_COMMON_SCREENSHOT_BIG
take a BIG screenshot
Definition: InputEngine.h:262
RoR::EV_COMMON_QUICKSAVE_06
@ EV_COMMON_QUICKSAVE_06
Definition: InputEngine.h:377
RoR::EV_TRUCK_ACCELERATE_MODIFIER_50
@ EV_TRUCK_ACCELERATE_MODIFIER_50
accelerate with 50 percent pedal input
Definition: InputEngine.h:299
RoR::EV_MENU_LEFT
@ EV_MENU_LEFT
select previous category
Definition: InputEngine.h:287
RoR::EV_COMMON_FULLSCREEN_TOGGLE
@ EV_COMMON_FULLSCREEN_TOGGLE
Definition: InputEngine.h:237
RoR::EV_AIRPLANE_RUDDER_LEFT
@ EV_AIRPLANE_RUDDER_LEFT
rudder left
Definition: InputEngine.h:90
Language.h
Script2Game::KC_SLASH
enum Script2Game::inputEvents KC_SLASH
RoR::EV_COMMON_QUICKLOAD_09
@ EV_COMMON_QUICKLOAD_09
Definition: InputEngine.h:391
RoR::EV_COMMANDS_48
@ EV_COMMANDS_48
Command 48.
Definition: InputEngine.h:186
RoR::EV_CHARACTER_ROT_UP
@ EV_CHARACTER_ROT_UP
Definition: InputEngine.h:135
RoR::InputEngine::logval
float logval(float val)
Definition: InputEngine.cpp:811
RoR::EV_TRUCK_SHIFT_GEAR10
@ EV_TRUCK_SHIFT_GEAR10
shift directly into this gear
Definition: InputEngine.h:341
RoR::InputEngine::getEventBoolValueBounce
bool getEventBoolValueBounce(int eventID, float time=0.2f)
Definition: InputEngine.cpp:762
RoR::event_trigger_t::joystickAxisNumber
int joystickAxisNumber
Definition: InputEngine.h:433
RoR::InputEngine::getEventValue
float getEventValue(int eventID, bool pure=false, InputSourceType valueSource=InputSourceType::IST_ANY)
valueSource: IST_ANY=digital and analog devices, IST_DIGITAL=only digital, IST_ANALOG=only analog
Definition: InputEngine.cpp:958
RoR::EV_CHARACTER_RIGHT
@ EV_CHARACTER_RIGHT
rotate character right
Definition: InputEngine.h:133
RoR::EV_TRUCK_ACCELERATE_MODIFIER_25
@ EV_TRUCK_ACCELERATE_MODIFIER_25
accelerate with 25 percent pedal input
Definition: InputEngine.h:298
RoR::InputEngine::resetKeysAndMouseButtons
void resetKeysAndMouseButtons()
Definition: InputEngine.cpp:729
RoR::Console::CONSOLE_SYSTEM_ERROR
@ CONSOLE_SYSTEM_ERROR
Definition: Console.h:52
RoR::InputEngine::addEvent
void addEvent(int eventID, event_trigger_t &t)
Registers new trigger for this event.
Definition: InputEngine.cpp:1240
RoR::EV_COMMANDS_67
@ EV_COMMANDS_67
Command 67.
Definition: InputEngine.h:205
GUIManager.h
RoR::EV_COMMON_SAVE_TERRAIN
@ EV_COMMON_SAVE_TERRAIN
save terrain mesh to file
Definition: InputEngine.h:260
RoR::ET_MouseButton
@ ET_MouseButton
Definition: InputEngine.h:54
RoR::InputEngine::processMouseMotionEvent
void processMouseMotionEvent(const OIS::MouseEvent &arg)
Definition: InputEngine.cpp:696
RoR::event_trigger_t::comments
char comments[1024]
Definition: InputEngine.h:454
RoR::EV_TRUCK_SHIFT_GEAR17
@ EV_TRUCK_SHIFT_GEAR17
shift directly into this gear
Definition: InputEngine.h:348
Actor.h
RoR::EV_AIRPLANE_REVERSE
@ EV_AIRPLANE_REVERSE
reverse the turboprops
Definition: InputEngine.h:89
RoR::InputEngine::getJoyVendor
std::string getJoyVendor(int joystickNumber)
Definition: InputEngine.cpp:1730
RoR::event_trigger_t
Definition: InputEngine.h:416
RoR::EV_COMMANDS_39
@ EV_COMMANDS_39
Command 39.
Definition: InputEngine.h:177
RoR::InputEngine::isKeyDown
bool isKeyDown(OIS::KeyCode mod)
Asks OIS directly.
Definition: InputEngine.cpp:1170
RoR::InputEngine::completeMissingEvents
void completeMissingEvents()
Definition: InputEngine.cpp:1877
RoR::InputEngine::getKeboardKeyForCommand
int getKeboardKeyForCommand(int eventID)
Returns -1 if not Keyboard.
Definition: InputEngine.cpp:919
RoR::EV_COMMANDS_14
@ EV_COMMANDS_14
Command 14.
Definition: InputEngine.h:152
RoR::event_trigger_t::explicite
bool explicite
Definition: InputEngine.h:423
RoR::ET_MouseAxisY
@ ET_MouseAxisY
Definition: InputEngine.h:56
RoR::EV_COMMANDS_59
@ EV_COMMANDS_59
Command 59.
Definition: InputEngine.h:197
RoR::ET_MouseAxisZ
@ ET_MouseAxisZ
Definition: InputEngine.h:57
RoR::EV_TRUCK_LIGHTTOGGLE10
@ EV_TRUCK_LIGHTTOGGLE10
toggle custom light 10
Definition: InputEngine.h:325
RoR::EV_TRUCK_SHIFT_GEAR08
@ EV_TRUCK_SHIFT_GEAR08
shift directly into this gear
Definition: InputEngine.h:339
RoR::InputEngine::updateConfigline
bool updateConfigline(event_trigger_t *t)
Definition: InputEngine.cpp:1809
RoR::InputEngine::loadMapping
bool loadMapping(Ogre::String fileName, int deviceID)
Definition: InputEngine.cpp:1957
RoR::EV_TRUCK_SHIFT_GEAR15
@ EV_TRUCK_SHIFT_GEAR15
shift directly into this gear
Definition: InputEngine.h:346
RoR::EV_AIRPLANE_FLAPS_MORE
@ EV_AIRPLANE_FLAPS_MORE
one step more flaps.
Definition: InputEngine.h:86
RoR::EV_COMMON_QUICKSAVE
@ EV_COMMON_QUICKSAVE
quicksave scene to the disk
Definition: InputEngine.h:248
RoR::EV_TRUCK_SHIFT_GEAR14
@ EV_TRUCK_SHIFT_GEAR14
shift directly into this gear
Definition: InputEngine.h:345
RoR::EV_COMMON_ACCELERATE_SIMULATION
@ EV_COMMON_ACCELERATE_SIMULATION
accelerate the simulation speed
Definition: InputEngine.h:223
RoR::InputEngine::getEventCommand
Ogre::String getEventCommand(int eventID)
Definition: InputEngine.cpp:820
RoR::EV_TRUCK_STEER_LEFT
@ EV_TRUCK_STEER_LEFT
steer left
Definition: InputEngine.h:357
RoR::EV_COMMON_QUICKSAVE_09
@ EV_COMMON_QUICKSAVE_09
Definition: InputEngine.h:380
RoR::EV_COMMON_PRESSURE_LESS
@ EV_COMMON_PRESSURE_LESS
decrease tire pressure (note: only very few trucks support this)
Definition: InputEngine.h:245
Script2Game::KC_LSHIFT
enum Script2Game::inputEvents KC_LSHIFT
BITMASK_SET_0
#define BITMASK_SET_0(VAR, FLAGS)
Definition: BitFlags.h:16
RoR::EV_CAMERA_ZOOM_OUT
@ EV_CAMERA_ZOOM_OUT
zoom camera out
Definition: InputEngine.h:127
Script2Game::KC_F4
enum Script2Game::inputEvents KC_F4
RoR::EV_COMMANDS_38
@ EV_COMMANDS_38
Command 38.
Definition: InputEngine.h:176
TOSTRING
#define TOSTRING(x)
Definition: Application.h:56
Script2Game::KC_NUMPAD0
enum Script2Game::inputEvents KC_NUMPAD0
RoR::EV_BOAT_THROTTLE_UP
@ EV_BOAT_THROTTLE_UP
increase throttle
Definition: InputEngine.h:109
RoR::InputEngine::getCurrentPovValue
int getCurrentPovValue(int &joystickNumber, int &pov, int &povdir)
Definition: InputEngine.cpp:1689
RoR::EV_CAMERA_FREE_MODE
@ EV_CAMERA_FREE_MODE
Definition: InputEngine.h:116
RoR::InputEngine::getEventDefaultConfig
Ogre::String getEventDefaultConfig(int eventID)
Definition: InputEngine.cpp:853
RoR::EV_MODE_LAST
@ EV_MODE_LAST
Definition: InputEngine.h:404
RoR::InputEngine::getMouseNormalizedScreenPos
Ogre::Vector2 getMouseNormalizedScreenPos()
Returns XY position in range from 0 (top/left) to 1 (bottom/right)
Definition: InputEngine.cpp:1707
RoR::EV_CAMERA_ZOOM_IN_FAST
@ EV_CAMERA_ZOOM_IN_FAST
zoom camera in faster
Definition: InputEngine.h:126
RoR::EV_COMMANDS_31
@ EV_COMMANDS_31
Command 31.
Definition: InputEngine.h:169
RoR::EV_TRUCK_TRAILER_PARKING_BRAKE
@ EV_TRUCK_TRAILER_PARKING_BRAKE
toggle trailer parking brake
Definition: InputEngine.h:328
RoR::InputEngine::getCurrentJoyButton
int getCurrentJoyButton(int &joystickNumber, int &button)
Definition: InputEngine.cpp:1672
Script2Game::KC_9
enum Script2Game::inputEvents KC_9
RoR::EV_TRUCK_SHIFT_GEAR18
@ EV_TRUCK_SHIFT_GEAR18
shift directly into this gear
Definition: InputEngine.h:349
RoR::EV_COMMANDS_15
@ EV_COMMANDS_15
Command 15.
Definition: InputEngine.h:153
RoR::EV_AIRPLANE_AIRBRAKES_LESS
@ EV_AIRPLANE_AIRBRAKES_LESS
Definition: InputEngine.h:78
RoR::EV_COMMON_CYCLE_TRUCK_LIGHTS
@ EV_COMMON_CYCLE_TRUCK_LIGHTS
cycle truck front light mode (off -> running light -> low beams -> off).
Definition: InputEngine.h:274
RoR::InputEngine::windowResized
void windowResized(Ogre::RenderWindow *rw)
Definition: InputEngine.cpp:644
RoR::InputEvent::description
Ogre::UTFString description
Definition: InputEngine.h:413
Script2Game::KC_F11
enum Script2Game::inputEvents KC_F11
RoR::InputEngine::Capture
void Capture()
Definition: InputEngine.cpp:628
RoR::EV_COMMANDS_24
@ EV_COMMANDS_24
Command 24.
Definition: InputEngine.h:162
Script2Game::KC_F7
enum Script2Game::inputEvents KC_F7
RoR::event_trigger_t::configDeviceID
int configDeviceID
For which device (which config file) was this binding defined?
Definition: InputEngine.h:420
RoR::EV_BOAT_REVERSE
@ EV_BOAT_REVERSE
no thrust
Definition: InputEngine.h:102
RoR::InputEngine::getKeyNameForKeyCode
std::string getKeyNameForKeyCode(OIS::KeyCode keycode)
Definition: InputEngine.cpp:612
RoR::EV_COMMON_QUICKLOAD_06
@ EV_COMMON_QUICKLOAD_06
Definition: InputEngine.h:388
RoR::EV_COMMANDS_74
@ EV_COMMANDS_74
Command 74.
Definition: InputEngine.h:212
RoR::EV_COMMANDS_64
@ EV_COMMANDS_64
Command 64.
Definition: InputEngine.h:202
RoR::EV_COMMANDS_23
@ EV_COMMANDS_23
Command 23.
Definition: InputEngine.h:161
RoR::InputEngine::InputEngine
InputEngine()
Definition: InputEngine.cpp:416
Script2Game::KC_SEMICOLON
enum Script2Game::inputEvents KC_SEMICOLON
RoR::EV_CAMERA_ROTATE_LEFT
@ EV_CAMERA_ROTATE_LEFT
rotate camera left
Definition: InputEngine.h:121
RoR::EV_TRUCK_STARTER
@ EV_TRUCK_STARTER
hold to start the engine
Definition: InputEngine.h:356
RoR::EV_COMMANDS_51
@ EV_COMMANDS_51
Command 51.
Definition: InputEngine.h:189
RoR::EV_TRUCK_LIGHTTOGGLE01
@ EV_TRUCK_LIGHTTOGGLE01
toggle custom light 1
Definition: InputEngine.h:316
Script2Game::KC_NUMPAD6
enum Script2Game::inputEvents KC_NUMPAD6
RoR::EV_ROAD_EDITOR_POINT_SET_POS
@ EV_ROAD_EDITOR_POINT_SET_POS
Definition: InputEngine.h:397
RoR::EV_TRUCK_LEFT_MIRROR_LEFT
@ EV_TRUCK_LEFT_MIRROR_LEFT
Definition: InputEngine.h:314
RoR::InputEngine::composeEventCommandString
std::string composeEventCommandString(event_trigger_t const &trig)
Definition: InputEngine.cpp:865
Script2Game::KC_NUMPAD5
enum Script2Game::inputEvents KC_NUMPAD5
RoR::InputEngine::isKeyDownValueBounce
bool isKeyDownValueBounce(OIS::KeyCode mod, float time=0.2f)
Definition: InputEngine.cpp:1182
Script2Game::KC_TAB
enum Script2Game::inputEvents KC_TAB
RoR::EV_COMMON_RESPAWN_LAST_TRUCK
@ EV_COMMON_RESPAWN_LAST_TRUCK
respawn last truck
Definition: InputEngine.h:233
Script2Game::KC_PERIOD
enum Script2Game::inputEvents KC_PERIOD
RoR::EV_COMMANDS_82
@ EV_COMMANDS_82
Command 82.
Definition: InputEngine.h:220
RoR::EV_COMMON_QUICKLOAD_02
@ EV_COMMON_QUICKLOAD_02
Definition: InputEngine.h:384
RoR::event_trigger_t::joystickAxisRegion
int joystickAxisRegion
Definition: InputEngine.h:436
Script2Game::KC_F6
enum Script2Game::inputEvents KC_F6
RoR::InputEngine::mJoy
OIS::JoyStick * mJoy[MAX_JOYSTICKS]
Definition: InputEngine.h:578
RoR::EV_CHARACTER_SIDESTEP_RIGHT
@ EV_CHARACTER_SIDESTEP_RIGHT
sidestep to the right
Definition: InputEngine.h:138
RoR::EV_COMMON_NETCHATDISPLAY
@ EV_COMMON_NETCHATDISPLAY
Definition: InputEngine.h:241
RoR::EV_COMMON_QUICKLOAD_07
@ EV_COMMON_QUICKLOAD_07
Definition: InputEngine.h:389
RoR::EV_COMMON_REPLAY_BACKWARD
@ EV_COMMON_REPLAY_BACKWARD
Definition: InputEngine.h:252
RoR::EV_ROAD_EDITOR_POINT_GOTO
@ EV_ROAD_EDITOR_POINT_GOTO
Definition: InputEngine.h:398
BITMASK_SET_1
#define BITMASK_SET_1(VAR, FLAGS)
Definition: BitFlags.h:17
RoR::EV_COMMON_QUICKLOAD_05
@ EV_COMMON_QUICKLOAD_05
Definition: InputEngine.h:387
strnlen
#define strnlen(str, len)
Definition: InputEngine.cpp:397
RoR::InputEngine::ProcessKeyRelease
void ProcessKeyRelease(const OIS::KeyEvent &arg)
Definition: InputEngine.cpp:690
Script2Game::KC_END
enum Script2Game::inputEvents KC_END
RoR::EV_CAMERA_ROTATE_DOWN
@ EV_CAMERA_ROTATE_DOWN
rotate camera down
Definition: InputEngine.h:120
RoR::InputEngine::updateEvent
void updateEvent(int eventID, const event_trigger_t &t)
Definition: InputEngine.cpp:1271
RoR::EV_AIRPLANE_TOGGLE_ENGINES
@ EV_AIRPLANE_TOGGLE_ENGINES
switch all engines on / off
Definition: InputEngine.h:100
RoR::EV_COMMON_TOGGLE_DASHBOARD
@ EV_COMMON_TOGGLE_DASHBOARD
display or hide the dashboard overlay
Definition: InputEngine.h:239
RoR::InputEngine::m_loaded_configs
std::string m_loaded_configs[MAX_JOYSTICKS]
Definition: InputEngine.h:593
RoR::InputEvent::name
Ogre::String name
Definition: InputEngine.h:410
RoR::event_trigger_t::joystickSliderReverse
int joystickSliderReverse
Definition: InputEngine.h:447
Script2Game::KC_F1
enum Script2Game::inputEvents KC_F1
RoR::EV_COMMON_QUICKSAVE_02
@ EV_COMMON_QUICKSAVE_02
Definition: InputEngine.h:373
RoR::event_trigger_t::joystickAxisDeadzone
float joystickAxisDeadzone
Definition: InputEngine.h:434
RoR::EV_SKY_INCREASE_TIME
@ EV_SKY_INCREASE_TIME
increase day-time
Definition: InputEngine.h:112
RoR::EV_COMMANDS_21
@ EV_COMMANDS_21
Command 21.
Definition: InputEngine.h:159
RoR::event_trigger_t::tmp_eventname
char tmp_eventname[128]
Definition: InputEngine.h:453
RoR::EV_COMMANDS_30
@ EV_COMMANDS_30
Command 30.
Definition: InputEngine.h:168
RoR::EV_BOAT_STEER_LEFT
@ EV_BOAT_STEER_LEFT
steer left a step
Definition: InputEngine.h:103
RoR::EV_TRUCK_LIGHTTOGGLE02
@ EV_TRUCK_LIGHTTOGGLE02
toggle custom light 2
Definition: InputEngine.h:317
RoR::EV_TRUCK_TOGGLE_TCASE_4WD_MODE
@ EV_TRUCK_TOGGLE_TCASE_4WD_MODE
toggle the transfer case 4wd mode
Definition: InputEngine.h:366
RoR::EV_COMMON_QUICKLOAD
@ EV_COMMON_QUICKLOAD
quickload scene from the disk
Definition: InputEngine.h:247
RoR::InputEngine::uniqueCounter
int uniqueCounter
Definition: InputEngine.h:581
RoR::EV_TRUCK_TOGGLE_VIDEOCAMERA
@ EV_TRUCK_TOGGLE_VIDEOCAMERA
toggle videocamera update
Definition: InputEngine.h:368
RoR::EV_COMMANDS_07
@ EV_COMMANDS_07
Command 7.
Definition: InputEngine.h:145
RoR::EV_COMMANDS_56
@ EV_COMMANDS_56
Command 56.
Definition: InputEngine.h:194
Script2Game::KC_SPACE
enum Script2Game::inputEvents KC_SPACE
MAX_JOYSTICK_POVS
#define MAX_JOYSTICK_POVS
Definition: InputEngine.h:41
RoR::EV_COMMON_REPLAY_FAST_FORWARD
@ EV_COMMON_REPLAY_FAST_FORWARD
Definition: InputEngine.h:254
RoR::EV_COMMON_SEND_CHAT
@ EV_COMMON_SEND_CHAT
send the chat text
Definition: InputEngine.h:264
Script2Game::KC_DOWN
enum Script2Game::inputEvents KC_DOWN
RoR::InputEngine::eventIDToName
static Ogre::String eventIDToName(int eventID)
Definition: InputEngine.cpp:2056
Script2Game::KC_8
enum Script2Game::inputEvents KC_8
Script2Game::KC_ADD
enum Script2Game::inputEvents KC_ADD
RoR::EV_COMMANDS_75
@ EV_COMMANDS_75
Command 75.
Definition: InputEngine.h:213
RoR::EV_COMMANDS_68
@ EV_COMMANDS_68
Command 68.
Definition: InputEngine.h:206
RoR::InputEngine::isEventDefined
bool isEventDefined(int eventID)
Definition: InputEngine.cpp:908
RoR::InputEngine::getEventBoolValue
bool getEventBoolValue(int eventID)
Definition: InputEngine.cpp:757
RoR::InputEngine::mForceFeedback
OIS::ForceFeedback * mForceFeedback
Definition: InputEngine.h:580
RoR::event_trigger_t::shift
bool shift
Definition: InputEngine.h:425
RoR::EV_CHARACTER_RUN
@ EV_CHARACTER_RUN
let the character run
Definition: InputEngine.h:136
RoR::EV_MENU_SELECT
@ EV_MENU_SELECT
select focussed item and close menu
Definition: InputEngine.h:289
Script2Game::KC_F12
enum Script2Game::inputEvents KC_F12
RoR::App::GetConsole
Console * GetConsole()
Definition: Application.cpp:270
RoR::EV_COMMON_LOCK
@ EV_COMMON_LOCK
connect hook node to a node in close proximity
Definition: InputEngine.h:240
RoR::EV_COMMANDS_57
@ EV_COMMANDS_57
Command 57.
Definition: InputEngine.h:195
RoR::InputEngine::getJoyComponentCount
int getJoyComponentCount(OIS::ComponentType type, int joystickNumber)
Definition: InputEngine.cpp:1723
RoR::EV_COMMON_TRUCK_REMOVE
@ EV_COMMON_TRUCK_REMOVE
Definition: InputEngine.h:280
RoR::EV_COMMON_QUICKSAVE_08
@ EV_COMMON_QUICKSAVE_08
Definition: InputEngine.h:379
RoR::EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF
@ EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF
toggle the inter wheel differential mode
Definition: InputEngine.h:364
RoR::InputEngine::setEventSimulatedValue
void setEventSimulatedValue(events eventID, float value)
Definition: InputEngine.cpp:747
RoR::ET_JoystickAxisRel
@ ET_JoystickAxisRel
Definition: InputEngine.h:60
RoR::InputEngine::event_states_supressed
std::map< int, bool > event_states_supressed
Definition: InputEngine.h:592
Script2Game::KC_F2
enum Script2Game::inputEvents KC_F2
RoR::EV_COMMANDS_46
@ EV_COMMANDS_46
Command 46.
Definition: InputEngine.h:184
Script2Game::KC_RBRACKET
enum Script2Game::inputEvents KC_RBRACKET
RoR::event_trigger_t::group
char group[128]
Definition: InputEngine.h:452
RoR::EV_BOAT_CENTER_RUDDER
@ EV_BOAT_CENTER_RUDDER
center the rudder
Definition: InputEngine.h:101
RoR::EV_COMMANDS_76
@ EV_COMMANDS_76
Command 76.
Definition: InputEngine.h:214
RoR::EV_COMMON_TOGGLE_MAT_DEBUG
@ EV_COMMON_TOGGLE_MAT_DEBUG
debug purpose - dont use (currently not used)
Definition: InputEngine.h:269
Script2Game::KC_5
enum Script2Game::inputEvents KC_5
RoR::InputEngine::resolveEventName
static int resolveEventName(Ogre::String eventName)
Definition: InputEngine.cpp:2043
RoR::EV_AIRPLANE_AIRBRAKES_MORE
@ EV_AIRPLANE_AIRBRAKES_MORE
Definition: InputEngine.h:79
RoR::EV_TRUCK_SHIFT_HIGHRANGE
@ EV_TRUCK_SHIFT_HIGHRANGE
select high range (13-18) for H-shaft
Definition: InputEngine.h:351
RoR::EV_AIRPLANE_FLAPS_FULL
@ EV_AIRPLANE_FLAPS_FULL
full flaps in an aircraft.
Definition: InputEngine.h:84
RoR::EV_CHARACTER_FORWARD
@ EV_CHARACTER_FORWARD
step forward with the character
Definition: InputEngine.h:130
RoR::EV_TRUCK_HORN
@ EV_TRUCK_HORN
truck horn
Definition: InputEngine.h:313
RoR::InputEngine::ProcessJoystickEvent
void ProcessJoystickEvent(const OIS::JoyStickEvent &arg)
Definition: InputEngine.cpp:676
RoR::EV_SURVEY_MAP_ZOOM_OUT
@ EV_SURVEY_MAP_ZOOM_OUT
decrease survey map scale
Definition: InputEngine.h:295
RoR::EV_COMMON_FOV_MORE
@ EV_COMMON_FOV_MORE
increases the current FOV value
Definition: InputEngine.h:235
Script2Game::KC_3
enum Script2Game::inputEvents KC_3
RoR::InputEngine::addEventDefault
void addEventDefault(int eventID, int deviceID=-1)
Adds a new trigger with builtin value for this event.
Definition: InputEngine.cpp:1261
RoR::ET_JoystickAxisAbs
@ ET_JoystickAxisAbs
Definition: InputEngine.h:59
RoR::EV_GRASS_LESS
@ EV_GRASS_LESS
EXPERIMENTAL: remove some grass.
Definition: InputEngine.h:281
RoR::EV_CAMERA_LOOKBACK
@ EV_CAMERA_LOOKBACK
look back (toggles between normal and lookback)
Definition: InputEngine.h:118
RoR::EV_CAMERA_FREE_MODE_FIX
@ EV_CAMERA_FREE_MODE_FIX
Definition: InputEngine.h:117
RoR::EV_COMMANDS_55
@ EV_COMMANDS_55
Command 55.
Definition: InputEngine.h:193
RoR::EV_BOAT_THROTTLE_AXIS
@ EV_BOAT_THROTTLE_AXIS
throttle axis. Only use this if you have fitting hardware :) (i.e. a Slider)
Definition: InputEngine.h:107
RoR::event_trigger_t::keyCode
int keyCode
Definition: InputEngine.h:422
RoR::EV_COMMON_SECURE_LOAD
@ EV_COMMON_SECURE_LOAD
tie a load to the truck
Definition: InputEngine.h:263
RoR::EV_COMMANDS_84
@ EV_COMMANDS_84
Command 84.
Definition: InputEngine.h:222
RoR::eventtypes
eventtypes
Definition: InputEngine.h:50
RoR::EV_COMMON_TOGGLE_REPLAY_MODE
@ EV_COMMON_TOGGLE_REPLAY_MODE
toggle replay mode
Definition: InputEngine.h:270
RoR::EV_COMMON_TOGGLE_TERRAIN_EDITOR
@ EV_COMMON_TOGGLE_TERRAIN_EDITOR
toggle terrain editor
Definition: InputEngine.h:267
Script2Game::KC_F9
enum Script2Game::inputEvents KC_F9
RoR::EV_COMMON_TOGGLE_TRUCK_LOW_BEAMS
@ EV_COMMON_TOGGLE_TRUCK_LOW_BEAMS
toggle truck low beams (on/off); also toggles running lights.
Definition: InputEngine.h:275
Script2Game::KC_NUMLOCK
enum Script2Game::inputEvents KC_NUMLOCK
Script2Game::KC_APOSTROPHE
enum Script2Game::inputEvents KC_APOSTROPHE
RoR::InputEngine::DEFAULT_MAPFILE
static const std::string DEFAULT_MAPFILE
= "input.map";
Definition: InputEngine.h:464
RoR::EV_COMMON_REPLAY_FAST_BACKWARD
@ EV_COMMON_REPLAY_FAST_BACKWARD
Definition: InputEngine.h:253
RoR::EV_TRUCK_SHIFT_GEAR02
@ EV_TRUCK_SHIFT_GEAR02
shift directly into this gear
Definition: InputEngine.h:333
RoR::EV_COMMANDS_19
@ EV_COMMANDS_19
Command 19.
Definition: InputEngine.h:157
Script2Game::KC_BACKSLASH
enum Script2Game::inputEvents KC_BACKSLASH
MAX_JOYSTICKS
#define MAX_JOYSTICKS
Definition: InputEngine.h:40
RoR::EV_SURVEY_MAP_TOGGLE_ICONS
@ EV_SURVEY_MAP_TOGGLE_ICONS
toggle map icons
Definition: InputEngine.h:291
RoR::InputEngine::getCurrentJoyState
OIS::JoyStickState * getCurrentJoyState(int joystickNumber)
Definition: InputEngine.cpp:1737
Script2Game::KC_LWIN
enum Script2Game::inputEvents KC_LWIN
_LC
#define _LC(ctx, str)
Definition: Language.h:42
RoR::InputEngine::getEventGroup
std::string getEventGroup(Ogre::String eventName)
Definition: InputEngine.cpp:1795
RoR::InputEvent
Definition: InputEngine.h:408
RoR::EV_TRUCK_SWITCH_SHIFT_MODES
@ EV_TRUCK_SWITCH_SHIFT_MODES
toggle between transmission modes
Definition: InputEngine.h:359
RoR::event_trigger_t::configline
char configline[256]
Mixed use: keyboard=key, joyButton=buttonNum, POV=direction, joyAxes=options.
Definition: InputEngine.h:451
RoR::EV_TRUCK_LIGHTTOGGLE08
@ EV_TRUCK_LIGHTTOGGLE08
toggle custom light 8
Definition: InputEngine.h:323
RoR::EV_COMMON_QUICKSAVE_04
@ EV_COMMON_QUICKSAVE_04
Definition: InputEngine.h:375
RoR::EV_COMMANDS_47
@ EV_COMMANDS_47
Command 47.
Definition: InputEngine.h:185
eventInfo
InputEvent eventInfo[]
Definition: InputEngine.cpp:37
RoR::ET_JoystickButton
@ ET_JoystickButton
Definition: InputEngine.h:58
RoR::ET_JoystickSliderY
@ ET_JoystickSliderY
Definition: InputEngine.h:63
RoR::EV_COMMANDS_77
@ EV_COMMANDS_77
Command 77.
Definition: InputEngine.h:215
RoR::InputEngine::eventIDToDescription
static Ogre::String eventIDToDescription(int eventID)
Definition: InputEngine.cpp:2068
RoR::EV_COMMANDS_35
@ EV_COMMANDS_35
Command 35.
Definition: InputEngine.h:173
RoR::EV_COMMANDS_01
@ EV_COMMANDS_01
Command 1.
Definition: InputEngine.h:139
Script2Game::KC_NUMPAD8
enum Script2Game::inputEvents KC_NUMPAD8
RoR::EV_TRUCK_LIGHTTOGGLE03
@ EV_TRUCK_LIGHTTOGGLE03
toggle custom light 3
Definition: InputEngine.h:318
RoR::EV_COMMANDS_63
@ EV_COMMANDS_63
Command 63.
Definition: InputEngine.h:201
RoR::App::io_input_grab_mode
CVar * io_input_grab_mode
Definition: Application.cpp:197
Script2Game::KC_RWIN
enum Script2Game::inputEvents KC_RWIN
RoR::InputEngine::allit
std::map< std::string, OIS::KeyCode >::iterator allit
Definition: InputEngine.h:601
RoR::EV_TRUCK_TOGGLE_TCASE_GEAR_RATIO
@ EV_TRUCK_TOGGLE_TCASE_GEAR_RATIO
toggle the transfer case gear ratio
Definition: InputEngine.h:367
RoR::EV_COMMANDS_71
@ EV_COMMANDS_71
Command 71.
Definition: InputEngine.h:209
RoR::EV_CAMERA_RESET
@ EV_CAMERA_RESET
reset the camera position
Definition: InputEngine.h:119
RoR::EV_TRUCK_ACCELERATE
@ EV_TRUCK_ACCELERATE
accelerate the truck
Definition: InputEngine.h:297
RoR::InputEngine::getTriggerCommand
Ogre::String getTriggerCommand(event_trigger_t const &evt)
Definition: InputEngine.cpp:837
RoR::InputEngine::event_values_simulated
std::map< int, float > event_values_simulated
Definition: InputEngine.h:590
RoR::EV_TRUCK_MANUAL_CLUTCH
@ EV_TRUCK_MANUAL_CLUTCH
manual clutch (for manual transmission)
Definition: InputEngine.h:326
Script2Game::KC_RSHIFT
enum Script2Game::inputEvents KC_RSHIFT
RoR::EV_COMMANDS_22
@ EV_COMMANDS_22
Command 22.
Definition: InputEngine.h:160
RoR::EV_AIRPLANE_FLAPS_NONE
@ EV_AIRPLANE_FLAPS_NONE
no flaps.
Definition: InputEngine.h:87
RoR::InputEngine::mKeyboard
OIS::Keyboard * mKeyboard
Definition: InputEngine.h:577
RoR::EV_COMMANDS_81
@ EV_COMMANDS_81
Command 81.
Definition: InputEngine.h:219
RoR::EV_TRUCK_LIGHTTOGGLE09
@ EV_TRUCK_LIGHTTOGGLE09
toggle custom light 9
Definition: InputEngine.h:324
RoR::EV_COMMON_NETCHATMODE
@ EV_COMMON_NETCHATMODE
Definition: InputEngine.h:242
RoR::event_trigger_t::joystickSliderRegion
int joystickSliderRegion
Definition: InputEngine.h:448
RoR::EV_TRUCK_SHIFT_GEAR03
@ EV_TRUCK_SHIFT_GEAR03
shift directly into this gear
Definition: InputEngine.h:334
RoR::EV_CAMERA_CHANGE
@ EV_CAMERA_CHANGE
change camera mode
Definition: InputEngine.h:114
RoR::EV_SKY_DECREASE_TIME
@ EV_SKY_DECREASE_TIME
decrease day-time
Definition: InputEngine.h:110
RoR::EV_AIRPLANE_STEER_RIGHT
@ EV_AIRPLANE_STEER_RIGHT
steer right
Definition: InputEngine.h:93
RoR::EV_AIRPLANE_FLAPS_LESS
@ EV_AIRPLANE_FLAPS_LESS
one step less flaps.
Definition: InputEngine.h:85
Script2Game::KC_F5
enum Script2Game::inputEvents KC_F5
Script2Game::KC_7
enum Script2Game::inputEvents KC_7
RoR::EV_COMMANDS_10
@ EV_COMMANDS_10
Command 10.
Definition: InputEngine.h:148
RoR::event_trigger_t::joystickAxisUseDigital
bool joystickAxisUseDigital
Definition: InputEngine.h:439
RoR::EV_GRASS_NONE
@ EV_GRASS_NONE
EXPERIMENTAL: remove grass completely.
Definition: InputEngine.h:284
RoR::InputSourceType
InputSourceType
Definition: InputEngine.h:67
RoR::EV_AIRPLANE_THROTTLE_FULL
@ EV_AIRPLANE_THROTTLE_FULL
full thrust
Definition: InputEngine.h:97
RoR::InputEngine::getLoadedConfigFile
std::string const & getLoadedConfigFile(int deviceID=-1)
Returns filename from loadConfigFile() call.
Definition: InputEngine.cpp:1948
RoR::InputSourceType::IST_DIGITAL
@ IST_DIGITAL
_L
#define _L
Definition: ErrorUtils.cpp:34
RoR::EV_TRUCK_STEER_RIGHT
@ EV_TRUCK_STEER_RIGHT
steer right
Definition: InputEngine.h:358
RoR::EV_COMMON_TOGGLE_TRUCK_HIGH_BEAMS
@ EV_COMMON_TOGGLE_TRUCK_HIGH_BEAMS
toggle truck high beams (on/off); doesn't need low beams, doesn't use 't' lights.
Definition: InputEngine.h:276
RoR::EV_COMMANDS_70
@ EV_COMMANDS_70
Command 70.
Definition: InputEngine.h:208
RoR::EV_COMMANDS_20
@ EV_COMMANDS_20
Command 20.
Definition: InputEngine.h:158
RoR::InputEngine::clearEvents
void clearEvents(int eventID)
Clears all bindings for given event.
Definition: InputEngine.cpp:1300
RoR::EV_COMMON_QUICKSAVE_10
@ EV_COMMON_QUICKSAVE_10
Definition: InputEngine.h:381
RoR::EV_TRUCK_TOGGLE_PHYSICS
@ EV_TRUCK_TOGGLE_PHYSICS
toggle physics simulation
Definition: InputEngine.h:365
RoR::EV_TRUCK_TOGGLE_INTER_AXLE_DIFF
@ EV_TRUCK_TOGGLE_INTER_AXLE_DIFF
toggle the inter axle differential mode
Definition: InputEngine.h:363
RoR::EV_AIRPLANE_THROTTLE_NO
@ EV_AIRPLANE_THROTTLE_NO
no thrust
Definition: InputEngine.h:98
RoR::EV_COMMANDS_12
@ EV_COMMANDS_12
Command 12.
Definition: InputEngine.h:150
RoR::EV_COMMON_TRUCK_DESCRIPTION
@ EV_COMMON_TRUCK_DESCRIPTION
toggle truck description
Definition: InputEngine.h:279
RoR::EV_COMMANDS_62
@ EV_COMMANDS_62
Command 62.
Definition: InputEngine.h:200
RoR::EV_COMMANDS_28
@ EV_COMMANDS_28
Command 28.
Definition: InputEngine.h:166
Script2Game::KC_UP
enum Script2Game::inputEvents KC_UP
RoR::App::GetInputEngine
InputEngine * GetInputEngine()
Definition: Application.cpp:271
RoR::EV_TRUCK_TOGGLE_IMPORTCOMMANDS
@ EV_TRUCK_TOGGLE_IMPORTCOMMANDS
toggle importcommands
Definition: InputEngine.h:362
RoR::EV_SKY_DECREASE_TIME_FAST
@ EV_SKY_DECREASE_TIME_FAST
decrease day-time a lot faster
Definition: InputEngine.h:111
RoR::IoInputGrabMode::ALL
@ ALL
RoR::EV_ROAD_EDITOR_POINT_DELETE
@ EV_ROAD_EDITOR_POINT_DELETE
Definition: InputEngine.h:399
RoR::EV_TRUCK_SHIFT_GEAR07
@ EV_TRUCK_SHIFT_GEAR07
shift directly into this gear
Definition: InputEngine.h:338
RoR::event_trigger_t::joystickSliderNumber
int joystickSliderNumber
Definition: InputEngine.h:446
RoR::EV_TRUCK_SHIFT_GEAR16
@ EV_TRUCK_SHIFT_GEAR16
shift directly into this gear
Definition: InputEngine.h:347
RoR::EV_COMMON_ENTER_CHATMODE
@ EV_COMMON_ENTER_CHATMODE
enter the chat mode
Definition: InputEngine.h:228
RoR::EV_COMMANDS_52
@ EV_COMMANDS_52
Command 52.
Definition: InputEngine.h:190
RoR::EV_BOAT_STEER_RIGHT
@ EV_BOAT_STEER_RIGHT
steer right a step
Definition: InputEngine.h:105
RoR::EV_GRASS_SAVE
@ EV_GRASS_SAVE
EXPERIMENTAL: save changes to the grass density image.
Definition: InputEngine.h:285
RoR::EV_COMMANDS_33
@ EV_COMMANDS_33
Command 33.
Definition: InputEngine.h:171
RoR::EV_COMMANDS_13
@ EV_COMMANDS_13
Command 13.
Definition: InputEngine.h:151
RoR::ET_NONE
@ ET_NONE
Definition: InputEngine.h:52
RoR::EV_CHARACTER_SIDESTEP_LEFT
@ EV_CHARACTER_SIDESTEP_LEFT
sidestep to the left
Definition: InputEngine.h:137
RoR::EV_COMMON_TOGGLE_CUSTOM_PARTICLES
@ EV_COMMON_TOGGLE_CUSTOM_PARTICLES
toggle particle cannon
Definition: InputEngine.h:268
RoR::EV_AIRPLANE_AIRBRAKES_FULL
@ EV_AIRPLANE_AIRBRAKES_FULL
Definition: InputEngine.h:77
RoR::EV_COMMANDS_42
@ EV_COMMANDS_42
Command 42.
Definition: InputEngine.h:180
RoR::EV_TRUCK_BLINK_LEFT
@ EV_TRUCK_BLINK_LEFT
toggle left direction indicator (blinker)
Definition: InputEngine.h:303
RoR::EV_COMMANDS_49
@ EV_COMMANDS_49
Command 49.
Definition: InputEngine.h:187
RoR::EV_AIRPLANE_PARKING_BRAKE
@ EV_AIRPLANE_PARKING_BRAKE
airplane parking brake.
Definition: InputEngine.h:88
RoR::EV_TRUCK_LIGHTTOGGLE07
@ EV_TRUCK_LIGHTTOGGLE07
toggle custom light 7
Definition: InputEngine.h:322
BitMask_t
uint32_t BitMask_t
Definition: BitFlags.h:7
RoR::EV_TRUCK_AUTOSHIFT_UP
@ EV_TRUCK_AUTOSHIFT_UP
shift automatic transmission one gear up
Definition: InputEngine.h:302
RoR::InputEngine::getModifierKeyName
Ogre::String getModifierKeyName(OIS::KeyCode key)
Definition: InputEngine.cpp:2241
InputEngine.h
Handles controller inputs from player. Defines input events and binding mechanism,...
RoR::EV_AIRPLANE_ELEVATOR_UP
@ EV_AIRPLANE_ELEVATOR_UP
pull the elevator up in an aircraft.
Definition: InputEngine.h:83
RoR::InputEngine::SetMouseListener
void SetMouseListener(OIS::MouseListener *obj)
Definition: InputEngine.cpp:661
Ogre
Definition: ExtinguishableFireAffector.cpp:35
RoR::EV_COMMON_OUTPUT_POSITION
@ EV_COMMON_OUTPUT_POSITION
write current position to log (you can open the logfile and reuse the position)
Definition: InputEngine.h:243
Script2Game::KC_MULTIPLY
enum Script2Game::inputEvents KC_MULTIPLY
RoR::InputEngine::isEventAnalog
bool isEventAnalog(int eventID)
Definition: InputEngine.cpp:931
RoR::event_trigger_t::joystickButtonNumber
int joystickButtonNumber
Definition: InputEngine.h:431
RoR::EV_COMMANDS_43
@ EV_COMMANDS_43
Command 43.
Definition: InputEngine.h:181
RoR::EV_AIRPLANE_BRAKE
@ EV_AIRPLANE_BRAKE
normal brake for an aircraft.
Definition: InputEngine.h:81
RoR::EV_AIRPLANE_THROTTLE_UP
@ EV_AIRPLANE_THROTTLE_UP
increase the airplane thrust
Definition: InputEngine.h:99
Script2Game::KC_F3
enum Script2Game::inputEvents KC_F3
RoR::InputEngine::isKeyDownEffective
bool isKeyDownEffective(OIS::KeyCode mod)
Reads RoR internal buffer.
Definition: InputEngine.cpp:1177
RoR::InputEngine::mInputManager
OIS::InputManager * mInputManager
Definition: InputEngine.h:569
RoR::InputEngine::eraseEvent
void eraseEvent(int eventID, const event_trigger_t *t)
Definition: InputEngine.cpp:1284
RoR::EV_COMMANDS_27
@ EV_COMMANDS_27
Command 27.
Definition: InputEngine.h:165
RoR::EV_COMMANDS_29
@ EV_COMMANDS_29
Command 29.
Definition: InputEngine.h:167
RoR::EV_ROAD_EDITOR_POINT_INSERT
@ EV_ROAD_EDITOR_POINT_INSERT
Definition: InputEngine.h:396
RoR::Console::CONSOLE_MSGTYPE_INFO
@ CONSOLE_MSGTYPE_INFO
Generic message.
Definition: Console.h:60
RoR::EV_TRUCK_AUTOSHIFT_DOWN
@ EV_TRUCK_AUTOSHIFT_DOWN
shift automatic transmission one gear down
Definition: InputEngine.h:301
RoR::InputEngine::mMouse
OIS::Mouse * mMouse
Definition: InputEngine.h:576
Script2Game::KC_LEFT
enum Script2Game::inputEvents KC_LEFT
RoR::EV_COMMANDS_16
@ EV_COMMANDS_16
Command 16.
Definition: InputEngine.h:154
RoR::EV_COMMON_QUICKLOAD_04
@ EV_COMMON_QUICKLOAD_04
Definition: InputEngine.h:386
RoR::EV_COMMON_TRUCK_INFO
@ EV_COMMON_TRUCK_INFO
toggle truck HUD
Definition: InputEngine.h:278
RoR::InputEngine::destroy
void destroy()
Definition: InputEngine.cpp:439
RoR::EV_CAMERA_UP
@ EV_CAMERA_UP
Definition: InputEngine.h:124
RoR::EV_COMMON_QUIT_GAME
@ EV_COMMON_QUIT_GAME
exit the game
Definition: InputEngine.h:249
RoR::EV_TRUCKEDIT_RELOAD
@ EV_TRUCKEDIT_RELOAD
Definition: InputEngine.h:394
RoR::EV_TRUCK_CRUISE_CONTROL_DECL
@ EV_TRUCK_CRUISE_CONTROL_DECL
decrease target speed / rpm
Definition: InputEngine.h:311
RoR::event_trigger_t::joystickPovNumber
int joystickPovNumber
Definition: InputEngine.h:442
RoR::EV_TRUCK_SHIFT_GEAR11
@ EV_TRUCK_SHIFT_GEAR11
shift directly into this gear
Definition: InputEngine.h:342
RoR::EV_AIRPLANE_STEER_LEFT
@ EV_AIRPLANE_STEER_LEFT
steer left
Definition: InputEngine.h:92
RoR::EV_COMMON_TOGGLE_STATS
@ EV_COMMON_TOGGLE_STATS
toggle Ogre statistics (FPS etc.)
Definition: InputEngine.h:272
RoR::events
events
Definition: InputEngine.h:74
RoR::EV_COMMON_RESET_SIMULATION_PACE
@ EV_COMMON_RESET_SIMULATION_PACE
reset the simulation speed
Definition: InputEngine.h:225
RoR::EV_COMMON_CYCLE_DEBUG_VIEWS
@ EV_COMMON_CYCLE_DEBUG_VIEWS
cycle debug view mode
Definition: InputEngine.h:266
RoR::InputEngine::composeEventConfigString
std::string composeEventConfigString(event_trigger_t const &trig)
Definition: InputEngine.cpp:887
RoR::EV_COMMANDS_11
@ EV_COMMANDS_11
Command 11.
Definition: InputEngine.h:149
RoR::InputEngine::keyState
std::map< int, bool > keyState
Definition: InputEngine.h:584
RoR::EV_AIRPLANE_THROTTLE_AXIS
@ EV_AIRPLANE_THROTTLE_AXIS
throttle axis. Only use this if you have fitting hardware :) (i.e. a Slider)
Definition: InputEngine.h:95
RoR::EV_COMMON_DECELERATE_SIMULATION
@ EV_COMMON_DECELERATE_SIMULATION
decelerate the simulation speed
Definition: InputEngine.h:224
RoR::EV_COMMON_QUICKSAVE_03
@ EV_COMMON_QUICKSAVE_03
Definition: InputEngine.h:374
RoR::EV_CHARACTER_LEFT
@ EV_CHARACTER_LEFT
rotate character left
Definition: InputEngine.h:132
RoR::EV_COMMANDS_44
@ EV_COMMANDS_44
Command 44.
Definition: InputEngine.h:182
RoR::EV_TRUCK_CRUISE_CONTROL_ACCL
@ EV_TRUCK_CRUISE_CONTROL_ACCL
increase target speed / rpm
Definition: InputEngine.h:310
Script2Game::KC_NUMPAD3
enum Script2Game::inputEvents KC_NUMPAD3
RoR::InputEngine::allkeys
std::map< std::string, OIS::KeyCode > allkeys
Definition: InputEngine.h:600
Script2Game::KC_2
enum Script2Game::inputEvents KC_2
RoR::EV_AIRPLANE_ELEVATOR_DOWN
@ EV_AIRPLANE_ELEVATOR_DOWN
pull the elevator down in an aircraft.
Definition: InputEngine.h:82
RoR::EV_COMMANDS_34
@ EV_COMMANDS_34
Command 34.
Definition: InputEngine.h:172
RoR::EV_COMMANDS_73
@ EV_COMMANDS_73
Command 73.
Definition: InputEngine.h:211
RoR::EV_COMMON_FOV_RESET
@ EV_COMMON_FOV_RESET
reset the FOV value
Definition: InputEngine.h:236
RoR::EV_CAMERA_DOWN
@ EV_CAMERA_DOWN
Definition: InputEngine.h:115
RoR::EV_TRUCK_SHIFT_NEUTRAL
@ EV_TRUCK_SHIFT_NEUTRAL
shift to neutral gear in manual transmission mode
Definition: InputEngine.h:354
Script2Game::KC_NUMPAD2
enum Script2Game::inputEvents KC_NUMPAD2
RoR
Definition: AppContext.h:36
RoR::EV_COMMANDS_36
@ EV_COMMANDS_36
Command 36.
Definition: InputEngine.h:174
RoR::EV_COMMON_QUICKSAVE_05
@ EV_COMMON_QUICKSAVE_05
Definition: InputEngine.h:376
RoR::EV_CAMERA_ROTATE_RIGHT
@ EV_CAMERA_ROTATE_RIGHT
rotate camera right
Definition: InputEngine.h:122
RoR::EV_COMMON_REMOVE_CURRENT_TRUCK
@ EV_COMMON_REMOVE_CURRENT_TRUCK
remove current truck
Definition: InputEngine.h:232
RoR::EV_COMMANDS_25
@ EV_COMMANDS_25
Command 25.
Definition: InputEngine.h:163
RoR::InputEngine::ProcessKeyPress
void ProcessKeyPress(const OIS::KeyEvent &arg)
Definition: InputEngine.cpp:685
Script2Game::KC_0
enum Script2Game::inputEvents KC_0
RoR::EV_BOAT_STEER_RIGHT_AXIS
@ EV_BOAT_STEER_RIGHT_AXIS
steer right (analog value!)
Definition: InputEngine.h:106
RoR::event_trigger_t::joystickNumber
int joystickNumber
Definition: InputEngine.h:430
RoR::EV_SKY_INCREASE_TIME_FAST
@ EV_SKY_INCREASE_TIME_FAST
increase day-time a lot faster
Definition: InputEngine.h:113
RoR::InputEngine::processMousePressEvent
void processMousePressEvent(const OIS::MouseEvent &arg, OIS::MouseButtonID _id)
Definition: InputEngine.cpp:704
RoR::InputEngine::mouseState
OIS::MouseState mouseState
Definition: InputEngine.h:586
RoR::EV_COMMON_RESCUE_TRUCK
@ EV_COMMON_RESCUE_TRUCK
teleport to rescue truck
Definition: InputEngine.h:256
OIS
Definition: ForceFeedback.h:25
RoR::EV_COMMANDS_78
@ EV_COMMANDS_78
Command 78.
Definition: InputEngine.h:216
RoR::EV_TRUCK_PARKING_BRAKE
@ EV_TRUCK_PARKING_BRAKE
toggle parking brake
Definition: InputEngine.h:327
RoR::EV_TRUCK_BRAKE
@ EV_TRUCK_BRAKE
brake
Definition: InputEngine.h:306
RoR::EV_COMMANDS_65
@ EV_COMMANDS_65
Command 65.
Definition: InputEngine.h:203
RoR::EV_COMMON_ROPELOCK
@ EV_COMMON_ROPELOCK
connect hook node to a node in close proximity
Definition: InputEngine.h:259
RoR::EV_COMMON_QUICKLOAD_08
@ EV_COMMON_QUICKLOAD_08
Definition: InputEngine.h:390
RoR::EV_COMMANDS_04
@ EV_COMMANDS_04
Command 4.
Definition: InputEngine.h:142
RoR::EV_TRUCK_SHIFT_GEAR05
@ EV_TRUCK_SHIFT_GEAR05
shift directly into this gear
Definition: InputEngine.h:336
RoR::EV_COMMON_TOGGLE_DEBUG_VIEW
@ EV_COMMON_TOGGLE_DEBUG_VIEW
toggle debug view mode
Definition: InputEngine.h:265
RoR::InputEngine::getEventBounceTime
float getEventBounceTime(int eventID)
Definition: InputEngine.cpp:775
RoR::EV_TRUCK_ANTILOCK_BRAKE
@ EV_TRUCK_ANTILOCK_BRAKE
toggle antilockbrake system
Definition: InputEngine.h:300
RoR::EV_TRUCK_SHIFT_GEAR_REVERSE
@ EV_TRUCK_SHIFT_GEAR_REVERSE
shift directly into this gear
Definition: InputEngine.h:350
RoR::EV_CHARACTER_JUMP
@ EV_CHARACTER_JUMP
let the character jump
Definition: InputEngine.h:131
RoR::InputEngine::deadZone
float deadZone(float axis, float dz)
Definition: InputEngine.cpp:791
RoR::InputEngine::SetKeyboardListener
void SetKeyboardListener(OIS::KeyListener *obj)
Definition: InputEngine.cpp:655
RoR::EV_TRUCK_SHIFT_LOWRANGE
@ EV_TRUCK_SHIFT_LOWRANGE
select low range (1-6) for H-shaft
Definition: InputEngine.h:352
RoR::EV_COMMON_QUICKLOAD_03
@ EV_COMMON_QUICKLOAD_03
Definition: InputEngine.h:385
RoR::EV_TRUCK_SHIFT_MIDRANGE
@ EV_TRUCK_SHIFT_MIDRANGE
select middle range (7-12) for H-shaft
Definition: InputEngine.h:353
RoR::EV_COMMANDS_05
@ EV_COMMANDS_05
Command 5.
Definition: InputEngine.h:143
Script2Game::KC_COMMA
enum Script2Game::inputEvents KC_COMMA
RoR::EV_TRUCK_LEFT_MIRROR_RIGHT
@ EV_TRUCK_LEFT_MIRROR_RIGHT
Definition: InputEngine.h:315
RoR::EV_COMMON_QUICKSAVE_01
@ EV_COMMON_QUICKSAVE_01
Definition: InputEngine.h:372
RoR::EV_COMMANDS_80
@ EV_COMMANDS_80
Command 80.
Definition: InputEngine.h:218