|
RigsofRods
Soft-body Physics Simulation
|
Go to the documentation of this file.
35 const char*
mOISDeviceType[6] = {
"Unknown Device",
"Keyboard",
"Mouse",
"JoyStick",
"Tablet",
"Other Device"};
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)")},
47 {
"COMMON_SCREENSHOT_BIG",
EV_COMMON_SCREENSHOT_BIG,
"Keyboard EXPL+CTRL+SYSRQ",
_LC(
"InputEvent",
"take a big screenshot (3 times the screen size)")},
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")},
55 {
"COMMON_FULLSCREEN_TOGGLE",
EV_COMMON_FULLSCREEN_TOGGLE,
"Keyboard EXPL+ALT+RETURN",
_LC(
"InputEvent",
"toggle between windowed and fullscreen mode")},
62 {
"COMMON_TRUCK_REMOVE",
EV_COMMON_TRUCK_REMOVE,
"Keyboard EXPL+CTRL+SHIFT+DELETE",
_LC(
"InputEvent",
"delete current truck")},
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")},
73 {
"COMMON_RESET_TRUCK",
EV_COMMON_RESET_TRUCK,
"Keyboard I",
_LC(
"InputEvent",
"reset truck to original starting position")},
92 {
"COMMON_HIDE_GUI",
EV_COMMON_HIDE_GUI,
"Keyboard EXPL+U",
_LC(
"InputEvent",
"hide all GUI elements")},
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.)")},
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")},
135 {
"TRUCK_HORN",
EV_TRUCK_HORN,
"Keyboard H",
_LC(
"InputEvent",
"truck horn")},
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")},
155 {
"TRUCK_STARTER",
EV_TRUCK_STARTER,
"Keyboard S",
_LC(
"InputEvent",
"hold to start the engine")},
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")},
204 {
"AIRPLANE_BRAKE",
EV_AIRPLANE_BRAKE,
"Keyboard B",
_LC(
"InputEvent",
"normal brake for an aircraft")},
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)")},
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)")},
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")},
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")},
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")},
346 {
"CAMERA_ZOOM_IN",
EV_CAMERA_ZOOM_IN,
"Keyboard EXPL+NUMPAD9",
_LC(
"InputEvent",
"zoom camera in")},
348 {
"CAMERA_ZOOM_OUT",
EV_CAMERA_ZOOM_OUT,
"Keyboard EXPL+NUMPAD3",
_LC(
"InputEvent",
"zoom camera out")},
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")},
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")},
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")},
383 {
"TRUCKEDIT_RELOAD",
EV_TRUCKEDIT_RELOAD,
"Keyboard EXPL+SHIFT+CTRL+R",
_LC(
"InputEvent",
"reload truck")},
396 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
397 #define strnlen(str,len) strlen(str)
402 #define OIS_DYNAMIC_LIB
405 #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
406 #include <X11/Xlib.h>
411 using namespace Ogre;
427 LOG(
"*** Loading OIS ***");
443 LOG(
"*** Terminating OIS ***");
475 LOG(
"*** Initializing OIS ***");
481 pl.insert(OIS::ParamList::value_type(
"WINDOW",
TOSTRING(hWnd)));
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"));
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"));
497 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
512 LOG(
"OIS Version: " +
TOSTRING(v>>16) + String(
".") +
TOSTRING((v>>8) & 0x000000FF) + String(
".") +
TOSTRING(v & 0x000000FF));
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);
530 mKeyboard->setTextTranslation(OIS::Keyboard::Unicode);
532 catch (OIS::Exception& ex)
534 LOG(String(
"Exception raised on keyboard creation: ") + String(ex.eText));
541 int numSticks = std::min(
mInputManager->getNumberOfDevices(OISJoyStick), 10);
543 for (
int i = 0; i < numSticks; ++i)
550 mForceFeedback = (OIS::ForceFeedback*)
mJoy[i]->queryInterface(OIS::Interface::ForceFeedback);
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)));
560 catch (OIS::Exception& ex)
562 LOG(String(
"Exception raised on joystick creation: ") + String(ex.eText));
569 catch (OIS::Exception& ex)
571 LOG(String(
"Exception raised on mouse creation: ") + String(ex.eText));
586 OIS::MouseState& mutableMouseState =
const_cast<OIS::MouseState &
>(
mMouse->getMouseState());
616 if (keycode == KC_LCONTROL || keycode == KC_RCONTROL)
618 if (keycode == KC_LMENU || keycode == KC_RMENU)
622 if (
allit->second == keycode)
647 unsigned int width, height, depth;
649 rw->getMetrics(width, height, depth, left, top);
650 const OIS::MouseState& ms =
mMouse->getMouseState();
658 mKeyboard->setEventCallback(keyboard_listener);
664 mMouse->setEventCallback(mouse_listener);
671 mJoy[i]->setEventCallback(obj);
678 int i = arg.device->getID();
707 if (_id == OIS::MB_Left)
731 for (std::map<int, bool>::iterator iter =
keyState.begin(); iter !=
keyState.end(); ++iter)
733 iter->second =
false;
798 if (fabs(axisValue) < dz)
803 return (axisValue - dz) * (1.0f / (1.0f - dz));
808 return (axisValue * linearity);
814 return log10(1.0 / (1.1 - val)) / 1.0;
817 return -log10(1.0 / (1.1 + val)) / 1.0;
822 std::vector<event_trigger_t>& t_vec =
events[eventID];
823 if (t_vec.size() > 0)
844 std::vector<event_trigger_t>& t_vec =
events[eventID];
845 if (t_vec.size() > 0)
910 std::vector<event_trigger_t> t_vec =
events[eventID];
911 if (t_vec.size() > 0)
913 if (t_vec[0].eventtype !=
ET_NONE)
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++)
933 std::vector<event_trigger_t> t_vec =
events[eventID];
934 if (t_vec.size() > 0)
938 for (
unsigned int i = 0; i < t_vec.size(); i++)
961 if (simulatedValue != 0.f)
962 return simulatedValue;
967 float returnValue = 0;
968 std::vector<event_trigger_t> t_vec =
events[eventID];
970 for (std::vector<event_trigger_t>::iterator i = t_vec.begin(); i != t_vec.end(); i++)
1095 value = (value + 1) / 2;
1118 value = (1.0 + value) / 2.0;
1120 value = 1.0 - value;
1156 value = (value + 1) / 2;
1158 value = 1.0 - value;
1164 if (value > returnValue)
1165 returnValue = value;
1236 default:
return "unknown";
1243 events[eventID].push_back(t);
1255 events[eventID] = std::vector<event_trigger_t>();
1278 events[eventID] = std::vector<event_trigger_t>();
1281 events[eventID].push_back(t);
1289 for (
size_t i = 0; i < triggers.size(); i++)
1291 if (t == &triggers[i])
1293 triggers.erase(triggers.begin() + i);
1310 for (
auto& ev_pair:
events)
1312 if (ev_pair.second.size() > 0)
1314 auto itor = ev_pair.second.begin();
1315 while (itor != ev_pair.second.end())
1317 if (itor->configDeviceID == deviceID)
1318 itor = ev_pair.second.erase(itor);
1334 static String cur_comment =
"";
1336 char eventName[256] =
"", evtype[256] =
"";
1337 const char delimiters[] =
"+";
1338 size_t linelen =
strnlen(line, 1024);
1342 float defaultDeadzone = 0.1f;
1343 float defaultLinearity = 1.0f;
1344 if (line[0] ==
';' || linelen < 5)
1346 cur_comment += line;;
1349 sscanf(line,
"%s %s", eventName, evtype);
1353 if (!strncmp(evtype,
"Keyboard", 8))
1355 else if (!strncmp(evtype,
"MouseButton", 10))
1357 else if (!strncmp(evtype,
"MouseAxisX", 9))
1359 else if (!strncmp(evtype,
"MouseAxisY", 9))
1361 else if (!strncmp(evtype,
"MouseAxisZ", 9))
1363 else if (!strncmp(evtype,
"JoystickButton", 14))
1365 else if (!strncmp(evtype,
"JoystickAxis", 12))
1368 else if (!strncmp(evtype,
"JoystickPov", 11))
1370 else if (!strncmp(evtype,
"JoystickSlider", 14))
1372 else if (!strncmp(evtype,
"JoystickSliderX", 15))
1374 else if (!strncmp(evtype,
"JoystickSliderY", 15))
1376 else if (!strncmp(evtype,
"None", 4))
1389 char keycodes[256] = {};
1390 char keycodes_work[256] = {};
1392 OIS::KeyCode key = KC_UNASSIGNED;
1394 sscanf(line,
"%s %s %s", eventName, evtype, keycodes);
1397 strncpy(keycodes_work, keycodes, 255);
1398 keycodes_work[255] =
'\0';
1399 char* token = strtok(keycodes_work, delimiters);
1401 while (token != NULL)
1403 if (strncmp(token,
"SHIFT", 5) == 0)
1405 else if (strncmp(token,
"CTRL", 4) == 0)
1407 else if (strncmp(token,
"ALT", 3) == 0)
1409 else if (strncmp(token,
"EXPL", 4) == 0)
1412 token = strtok(NULL, delimiters);
1419 LOG(
"unknown key: " +
string(keycodes));
1421 key = KC_UNASSIGNED;
1426 key =
allit->second;
1431 LOG(
"Error while processing input config: Unknown Event: "+String(eventName));
1437 t_key.
shift = shift;
1447 strncpy(t_key.
comments, cur_comment.c_str(), 1024);
1455 char tmp2[256] = {};
1456 sscanf(line,
"%s %s %d %d %s", eventName, evtype, &joyNo, &buttonNo, tmp2);
1465 if (!strcmp(tmp2,
"!NEW!"))
1472 sprintf(tmp,
"%d", buttonNo);
1477 strncpy(t_joy.
comments, cur_comment.c_str(), 1024);
1486 char options[256] = {};
1487 sscanf(line,
"%s %s %d %d %s", eventName, evtype, &joyNo, &axisNo, options);
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;
1504 strcpy(tmp, options);
1506 char* token = strtok(tmp, delimiters);
1507 while (token != NULL)
1509 if (strncmp(token,
"HALF", 4) == 0)
1511 else if (strncmp(token,
"REVERSE", 7) == 0)
1513 else if (strncmp(token,
"LINEAR", 6) == 0)
1515 else if (strncmp(token,
"UPPER", 5) == 0)
1517 else if (strncmp(token,
"LOWER", 5) == 0)
1519 else if (strncmp(token,
"RELATIVE", 8) == 0)
1521 else if (strncmp(token,
"DIGITAL", 7) == 0)
1523 else if (strncmp(token,
"DEADZONE", 8) == 0 &&
strnlen(token, 250) > 9)
1525 char tmp2[256] = {};
1526 strcpy(tmp2, token + 9);
1527 deadzone = atof(tmp2);
1530 else if (strncmp(token,
"LINEARITY", 9) == 0 &&
strnlen(token, 250) > 10)
1532 char tmp2[256] = {};
1533 strcpy(tmp2, token + 10);
1534 linearity = atof(tmp2);
1536 token = strtok(NULL, delimiters);
1556 strncpy(t_joy.
comments, cur_comment.c_str(), 1024);
1581 sscanf(line,
"%s %s %d %d %s", eventName, evtype, &joyNo, &povNumber, dir);
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;
1613 strncpy(t_pov.
comments, cur_comment.c_str(), 1024);
1623 int sliderNumber = 0;
1624 char options[256] = {};
1626 sscanf(line,
"%s %s %d %c %d %s", eventName, evtype, &joyNo, &type, &sliderNumber, options);
1631 bool reverse =
false;
1633 strncpy(tmp, options, 255);
1635 char* token = strtok(tmp, delimiters);
1636 while (token != NULL)
1638 if (strncmp(token,
"REVERSE", 7) == 0)
1641 token = strtok(NULL, delimiters);
1647 if (type ==
'Y' || type ==
'y')
1649 else if (type ==
'X' || type ==
'x')
1661 strncpy(t_slider.
comments, cur_comment.c_str(), 1024);
1676 for (
int i = 0; i < (int)
joyState[j].mButtons.size(); i++)
1695 if (
joyState[j].mPOV[i].direction != Pov::Centered)
1699 povdir =
joyState[j].mPOV[i].direction;
1709 OIS::MouseState
const& mstate =
mMouse->getMouseState();
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);
1727 return mJoy[joystickNumber]->getNumberOfComponents(type);
1734 return mJoy[joystickNumber]->vendor();
1746 std::map<int, bool>::iterator i;
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)
1762 *combo = *combo +
"+" + keyName;
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)
1777 *combo = *combo +
"+" + keyName;
1783 if (modCounter > 0 && keyCounter == 0)
1787 else if (keyCounter == 0 && modCounter == 0)
1789 *combo =
_L(
"(Please press a key)");
1797 const char delimiters[] =
"_";
1799 strncpy(tmp, eventName.c_str(), 255);
1801 char* token = strtok(tmp, delimiters);
1802 while (token != NULL)
1804 return String(token);
1905 String deviceStr =
mJoy[deviceID]->vendor();
1908 String repl =
"\\/ #@?!$%^&*()+=-><.:'|\";";
1909 for (
unsigned int c = 0; c < repl.size(); c++)
1911 deviceStr = StringUtil::replaceAll(deviceStr, repl.substr(c, 1),
"_");
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";
1921 if (osSpecificMapFile !=
"" &&
1922 ResourceGroupManager::getSingleton().resourceExists(
RGN_CONFIG, osSpecificMapFile))
1924 fileName = osSpecificMapFile;
1929 fileName = deviceStr +
".map";
1959 char line[1025] =
"";
1962 LOG(
" * Loading input mapping " + fileName);
1967 ds = ResourceGroupManager::getSingleton().openResource(fileName,
RGN_CONFIG);
1976 if (ds->tell() + size >= ds->size())
1977 size = ds->size() - ds->tell();
1978 if (ds->tell() >= ds->size())
1980 size_t readnum = ds->readLine(line, size);
1987 LOG(
" * Input map successfully loaded: " +
TOSTRING(newEvents) +
" entries");
1993 const int COL1_WIDTH = 34;
1994 const int COL2_WIDTH = 19;
1999 Ogre::DataStreamPtr ds = Ogre::ResourceGroupManager::getSingleton().createResource(
2003 for (
auto& ev_pair:
events)
2025 std::string line =
fmt::format(
"{:<{}} {:<{}} {}\n",
2027 this->getEventTypeName(ev.
eventtype), COL2_WIDTH,
2029 ds->write(line.c_str(), line.size());
2035 catch (Ogre::Exception& e)
2038 fmt::format(
"Failed to write '{}', {}", fileName, e.getDescription()));
2052 LOG(
"unknown event (ignored): " + eventName);
2093 allkeys[
"ABNT_C1"] = KC_ABNT_C1;
2094 allkeys[
"ABNT_C2"] = KC_ABNT_C2;
2104 allkeys[
"CALCULATOR"] = KC_CALCULATOR;
2105 allkeys[
"CAPITAL"] = KC_CAPITAL;
2108 allkeys[
"CONVERT"] = KC_CONVERT;
2110 allkeys[
"DECIMAL"] = KC_DECIMAL;
2112 allkeys[
"DIVIDE"] = KC_DIVIDE;
2146 allkeys[
"LCONTROL"] = KC_LCONTROL;
2153 allkeys[
"MEDIASELECT"] = KC_MEDIASELECT;
2154 allkeys[
"MEDIASTOP"] = KC_MEDIASTOP;
2158 allkeys[
"MYCOMPUTER"] = KC_MYCOMPUTER;
2160 allkeys[
"NEXTTRACK"] = KC_NEXTTRACK;
2161 allkeys[
"NOCONVERT"] = KC_NOCONVERT;
2173 allkeys[
"NUMPADCOMMA"] = KC_NUMPADCOMMA;
2174 allkeys[
"NUMPADENTER"] = KC_NUMPADENTER;
2175 allkeys[
"NUMPADEQUALS"] = KC_NUMPADEQUALS;
2177 allkeys[
"OEM_102"] = KC_OEM_102;
2183 allkeys[
"PLAYPAUSE"] = KC_PLAYPAUSE;
2185 allkeys[
"PREVTRACK"] = KC_PREVTRACK;
2189 allkeys[
"RCONTROL"] = KC_RCONTROL;
2196 allkeys[
"SCROLL"] = KC_SCROLL;
2207 allkeys[
"UNDERLINE"] = KC_UNDERLINE;
2208 allkeys[
"UNLABELED"] = KC_UNLABELED;
2211 allkeys[
"VOLUMEDOWN"] = KC_VOLUMEDOWN;
2212 allkeys[
"VOLUMEUP"] = KC_VOLUMEUP;
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;
2230 std::map<int, std::vector<event_trigger_t>>::iterator it =
events.find(eventID);
2234 if (it->second.empty())
2237 std::vector<event_trigger_t>::iterator it2 = it->second.begin();
2245 case OIS::KC_LMENU:
return _LC(
"ModifierKey",
"Left Alt");
2247 case OIS::KC_LCONTROL:
return _LC(
"ModifierKey",
"Left Ctrl");
2249 case OIS::KC_RMENU:
return _LC(
"ModifierKey",
"Right Alt");
2251 case OIS::KC_RCONTROL:
return _LC(
"ModifierKey",
"Right Ctrl");
enum Script2Game::inputEvents KC_SUBTRACT
#define ROR_ASSERT(_EXPR)
enum Script2Game::inputEvents KC_4
enum Script2Game::inputEvents KC_NUMPAD1
enum Script2Game::inputEvents KC_INSERT
enum Script2Game::inputEvents KC_1
enum Script2Game::inputEvents KC_HOME
enum Script2Game::inputEvents KC_LBRACKET
enum Script2Game::inputEvents KC_PAUSE
enum Script2Game::inputEvents KC_NUMPAD7
enum Script2Game::inputEvents KC_NUMPAD4
enum Script2Game::inputEvents KC_PGDOWN
enum Script2Game::inputEvents KC_MINUS
enum Script2Game::inputEvents KC_DELETE
enum Script2Game::inputEvents KC_NUMPAD9
enum Script2Game::inputEvents KC_6
enum Script2Game::inputEvents KC_PGUP
Ogre::RenderWindow * GetRenderWindow()
enum Script2Game::inputEvents KC_GRAVE
AppContext * GetAppContext()
enum Script2Game::inputEvents KC_F10
Truck file format(technical spec)
enum eventtypes eventtype
enum Script2Game::inputEvents KC_F8
enum Script2Game::inputEvents KC_RETURN
enum Script2Game::inputEvents KC_EQUALS
float joystickAxisLinearity
enum Script2Game::inputEvents KC_RIGHT
System integration layer; inspired by OgreBites::ApplicationContext.
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
enum Script2Game::inputEvents KC_ESCAPE
enum Script2Game::inputEvents KC_SLASH
enum Script2Game::inputEvents KC_LSHIFT
#define BITMASK_SET_0(VAR, FLAGS)
enum Script2Game::inputEvents KC_F4
enum Script2Game::inputEvents KC_NUMPAD0
enum Script2Game::inputEvents KC_9
enum Script2Game::inputEvents KC_F11
enum Script2Game::inputEvents KC_F7
int configDeviceID
For which device (which config file) was this binding defined?
enum Script2Game::inputEvents KC_SEMICOLON
enum Script2Game::inputEvents KC_NUMPAD6
enum Script2Game::inputEvents KC_NUMPAD5
enum Script2Game::inputEvents KC_TAB
enum Script2Game::inputEvents KC_PERIOD
enum Script2Game::inputEvents KC_F6
#define BITMASK_SET_1(VAR, FLAGS)
enum Script2Game::inputEvents KC_END
int joystickSliderReverse
enum Script2Game::inputEvents KC_F1
float joystickAxisDeadzone
enum Script2Game::inputEvents KC_SPACE
enum Script2Game::inputEvents KC_DOWN
enum Script2Game::inputEvents KC_8
enum Script2Game::inputEvents KC_ADD
enum Script2Game::inputEvents KC_F12
enum Script2Game::inputEvents KC_F2
enum Script2Game::inputEvents KC_RBRACKET
enum Script2Game::inputEvents KC_5
enum Script2Game::inputEvents KC_3
enum Script2Game::inputEvents KC_F9
enum Script2Game::inputEvents KC_NUMLOCK
enum Script2Game::inputEvents KC_APOSTROPHE
enum Script2Game::inputEvents KC_BACKSLASH
enum Script2Game::inputEvents KC_LWIN
char configline[256]
Mixed use: keyboard=key, joyButton=buttonNum, POV=direction, joyAxes=options.
enum Script2Game::inputEvents KC_NUMPAD8
CVar * io_input_grab_mode
enum Script2Game::inputEvents KC_RWIN
enum Script2Game::inputEvents KC_RSHIFT
enum Script2Game::inputEvents KC_F5
enum Script2Game::inputEvents KC_7
bool joystickAxisUseDigital
enum Script2Game::inputEvents KC_UP
InputEngine * GetInputEngine()
enum Script2Game::inputEvents KC_MULTIPLY
enum Script2Game::inputEvents KC_F3
@ CONSOLE_MSGTYPE_INFO
Generic message.
enum Script2Game::inputEvents KC_LEFT
enum Script2Game::inputEvents KC_NUMPAD3
enum Script2Game::inputEvents KC_2
enum Script2Game::inputEvents KC_NUMPAD2
enum Script2Game::inputEvents KC_0
enum Script2Game::inputEvents KC_COMMA