MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ProcessKeys

Function ProcessKeys

Descent3/GameLoop.cpp:2398–2439  ·  view source on GitHub ↗

Get and handle all pending keys

Source from the content-addressed store, hash-verified

2396void DemoCheats(int key);
2397// Get and handle all pending keys
2398void ProcessKeys() {
2399 int key;
2400
2401 if (Dedicated_server)
2402 return; // No key processing for dedicated server!
2403
2404 // if we are in some menu then don't process game keys!
2405 if (Game_interface_mode != GAME_INTERFACE || Menu_interface_mode)
2406 return;
2407
2408 // Process all pending keys
2409 while ((key = ddio_KeyInKey()) != 0) {
2410
2411 // Where does this belong?
2412 // do d3x debugging console
2413 // D3XDebugIO(key);
2414
2415 // If inputting a multiplayer message, send keys there
2416 if (Doing_input_message) {
2417 DoHUDInputMessageKey(key);
2418 continue;
2419 }
2420
2421 // If multiplayer, send the key to the game DLL
2422 if (Game_mode & GM_MULTI) {
2423 if (!SendKeyToGameDLL(key)) // returns true if should keep processing this key
2424 continue; // the DLL says not process this key
2425 }
2426
2427 // Handle normal key
2428 ProcessNormalKey(key);
2429
2430// Handle debugging & test keys
2431#ifdef _DEBUG
2432 ProcessTestKeys(key);
2433#endif
2434
2435 // #ifdef DEMO
2436 DemoCheats(key);
2437 // #endif
2438 }
2439}
2440
2441// Render the world into a game window
2442// Parameters: viewer - if not null, this object disabled from rendering. Not used otherwise.

Callers 1

GameFrameFunction · 0.85

Calls 6

ddio_KeyInKeyFunction · 0.85
DoHUDInputMessageKeyFunction · 0.85
SendKeyToGameDLLFunction · 0.85
ProcessNormalKeyFunction · 0.85
ProcessTestKeysFunction · 0.85
DemoCheatsFunction · 0.85

Tested by

no test coverage detected