MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / ClearInputKeys

Method ClearInputKeys

imgui_tiny_app/imgui/imgui.cpp:1801–1816  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1799
1800// Clear current keyboard/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons.
1801void ImGuiIO::ClearInputKeys()
1802{
1803 ImGuiContext& g = *Ctx;
1804 for (int key = ImGuiKey_NamedKey_BEGIN; key < ImGuiKey_NamedKey_END; key++)
1805 {
1806 if (ImGui::IsMouseKey((ImGuiKey)key))
1807 continue;
1808 ImGuiKeyData* key_data = &g.IO.KeysData[key - ImGuiKey_NamedKey_BEGIN];
1809 key_data->Down = false;
1810 key_data->DownDuration = -1.0f;
1811 key_data->DownDurationPrev = -1.0f;
1812 }
1813 KeyCtrl = KeyShift = KeyAlt = KeySuper = false;
1814 KeyMods = ImGuiMod_None;
1815 InputQueueCharacters.resize(0); // Behavior of old ClearInputCharacters().
1816}
1817
1818void ImGuiIO::ClearInputMouse()
1819{

Callers 2

UpdateKeyboardInputsMethod · 0.80
UpdateInputEventsMethod · 0.80

Calls 2

IsMouseKeyFunction · 0.85
resizeMethod · 0.45

Tested by

no test coverage detected