Clear current keyboard/mouse/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons.
| 1403 | |
| 1404 | // Clear current keyboard/mouse/gamepad state + current frame text input buffer. Equivalent to releasing all keys/buttons. |
| 1405 | void 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(). |
no test coverage detected