MCPcopy Create free account
hub / github.com/clementgallet/libTAS / ClearInputKeys

Method ClearInputKeys

src/external/imgui/imgui.cpp:1405–1426  ·  view source on GitHub ↗

Clear current keyboard/mouse/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons.

Source from the content-addressed store, hash-verified

1403
1404// Clear current keyboard/mouse/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons.
1405void ImGuiIO::ClearInputKeys()
1406{
1407#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
1408 memset(KeysDown, 0, sizeof(KeysDown));
1409#endif
1410 for (int n = 0; n < IM_ARRAYSIZE(KeysData); n++)
1411 {
1412 KeysData[n].Down = false;
1413 KeysData[n].DownDuration = -1.0f;
1414 KeysData[n].DownDurationPrev = -1.0f;
1415 }
1416 KeyCtrl = KeyShift = KeyAlt = KeySuper = false;
1417 KeyMods = ImGuiMod_None;
1418 MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
1419 for (int n = 0; n < IM_ARRAYSIZE(MouseDown); n++)
1420 {
1421 MouseDown[n] = false;
1422 MouseDownDuration[n] = MouseDownDurationPrev[n] = -1.0f;
1423 }
1424 MouseWheel = MouseWheelH = 0.0f;
1425 InputQueueCharacters.resize(0); // Behavior of old ClearInputCharacters().
1426}
1427
1428// Removed this as it is ambiguous/misleading and generally incorrect to use with the existence of a higher-level input queue.
1429// Current frame character buffer is now also cleared by ClearInputKeys().

Callers 1

UpdateInputEventsMethod · 0.80

Calls 2

ImVec2Function · 0.85
resizeMethod · 0.45

Tested by

no test coverage detected