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

Function getNextKey

src/OpenLoco/src/Input/Keyboard.cpp:235–251  ·  view source on GitHub ↗

0x00407028

Source from the content-addressed store, hash-verified

233
234 // 0x00407028
235 static std::optional<Key> getNextKey()
236 {
237 uint32_t readIndex = _keyQueueReadIndex;
238 if (readIndex == _keyQueueWriteIndex)
239 {
240 return std::nullopt;
241 }
242
243 const auto nextKey = _keyQueue[readIndex];
244 readIndex++;
245
246 // Wrap around at _keyQueue size
247 readIndex %= std::size(_keyQueue);
248 _keyQueueReadIndex = readIndex;
249
250 return nextKey;
251 }
252
253 static bool tryShortcut(Shortcut sc, uint32_t keyCode, KeyModifier modifiers)
254 {

Callers 1

normalKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected