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