MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / ReadKeyboard

Function ReadKeyboard

TombEngine/Specific/Input/Input.cpp:303–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301 }
302
303 static void ReadKeyboard()
304 {
305 if (InputLocked || OisKeyboard == nullptr)
306 return;
307
308 try
309 {
310 OisKeyboard->capture();
311
312 // Poll keyboard keys.
313 for (int i = 0; i < KEYBOARD_KEY_COUNT; i++)
314 {
315 if (!OisKeyboard->isKeyDown((OIS::KeyCode)i))
316 continue;
317
318 int key = WrapSimilarKeys(i);
319 KeyMap[key] = 1.0f;
320
321 // Interpret discrete directional keypresses as analog axis values.
322 SetDiscreteAxisValues(key);
323 }
324 }
325 catch (OIS::Exception& ex)
326 {
327 TENLog("Unable to poll keyboard input: " + std::string(ex.eText), LogLevel::Warning);
328 }
329 }
330
331 static void ReadMouse()
332 {

Callers 1

UpdateInputActionsFunction · 0.85

Calls 3

WrapSimilarKeysFunction · 0.85
SetDiscreteAxisValuesFunction · 0.85
TENLogFunction · 0.85

Tested by

no test coverage detected