MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / normalKey

Function normalKey

src/OpenLoco/src/Input/Keyboard.cpp:313–408  ·  view source on GitHub ↗

0x004BEDA0

Source from the content-addressed store, hash-verified

311
312 // 0x004BEDA0
313 static void normalKey()
314 {
315 while (true)
316 {
317 auto nextKey = getNextKey();
318 if (!nextKey.has_value())
319 {
320 loc_4BEFEF();
321 break;
322 }
323
324 if (nextKey->keyCode == SDLK_LSHIFT || nextKey->keyCode == SDLK_RSHIFT)
325 {
326 continue;
327 }
328
329 if (nextKey->keyCode == SDLK_LCTRL || nextKey->keyCode == SDLK_RCTRL)
330 {
331 continue;
332 }
333
334 if (hasKeyModifier(KeyModifier::cheat))
335 {
336 if (nextKey->charCode >= 'a' && nextKey->charCode <= 'z')
337 {
338 nextKey->charCode = toupper(nextKey->charCode);
339 }
340
341 if (nextKey->charCode >= 'A' && nextKey->charCode <= 'Z')
342 {
343 _cheatBuffer += nextKey->charCode;
344 }
345
346 continue;
347 }
348
349 if (WindowManager::callKeyUpEventBackToFront(nextKey->charCode, nextKey->keyCode))
350 {
351 continue;
352 }
353
354 if (tryShortcut(Shortcut::screenshot, nextKey->keyCode, _keyModifier))
355 {
356 continue;
357 }
358
359 if (Tutorial::state() == Tutorial::State::playing)
360 {
361 Tutorial::stop();
362 continue;
363 }
364
365 if (tryShortcut(Shortcut::openDebugWindow, nextKey->keyCode, _keyModifier))
366 {
367 continue;
368 }
369
370 if (!SceneManager::isTitleMode())

Callers 1

processKeyboardInputFunction · 0.85

Calls 9

getNextKeyFunction · 0.85
loc_4BEFEFFunction · 0.85
hasKeyModifierFunction · 0.85
tryShortcutFunction · 0.85
isTitleModeFunction · 0.85
isActiveFunction · 0.85
stateFunction · 0.50
stopFunction · 0.50

Tested by

no test coverage detected