MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / ClearInputKeys

Method ClearInputKeys

KBotExt/imgui/imgui.cpp:1370–1391  ·  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

1368
1369// Clear current keyboard/mouse/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons.
1370void ImGuiIO::ClearInputKeys()
1371{
1372#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
1373 memset(KeysDown, 0, sizeof(KeysDown));
1374#endif
1375 for (int n = 0; n < IM_ARRAYSIZE(KeysData); n++)
1376 {
1377 KeysData[n].Down = false;
1378 KeysData[n].DownDuration = -1.0f;
1379 KeysData[n].DownDurationPrev = -1.0f;
1380 }
1381 KeyCtrl = KeyShift = KeyAlt = KeySuper = false;
1382 KeyMods = ImGuiMod_None;
1383 MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
1384 for (int n = 0; n < IM_ARRAYSIZE(MouseDown); n++)
1385 {
1386 MouseDown[n] = false;
1387 MouseDownDuration[n] = MouseDownDurationPrev[n] = -1.0f;
1388 }
1389 MouseWheel = MouseWheelH = 0.0f;
1390 InputQueueCharacters.resize(0); // Behavior of old ClearInputCharacters().
1391}
1392
1393// Removed this as it is ambiguous/misleading and generally incorrect to use with the existence of a higher-level input queue.
1394// Current frame character buffer is now also cleared by ClearInputKeys().

Callers 1

UpdateInputEventsMethod · 0.80

Calls 1

ImVec2Function · 0.85

Tested by

no test coverage detected