| 4190 | } |
| 4191 | |
| 4192 | void ImGuiInputTextState::OnCharPressed(unsigned int c) |
| 4193 | { |
| 4194 | // Convert the key to a UTF8 byte sequence. |
| 4195 | // The changes we had to make to stb_textedit_key made it very much UTF-8 specific which is not too great. |
| 4196 | char utf8[5]; |
| 4197 | ImTextCharToUtf8(utf8, c); |
| 4198 | stb_textedit_text(this, Stb, utf8, (int)ImStrlen(utf8)); |
| 4199 | CursorFollow = true; |
| 4200 | CursorAnimReset(); |
| 4201 | } |
| 4202 | |
| 4203 | // Those functions are not inlined in imgui_internal.h, allowing us to hide ImStbTexteditState from that header. |
| 4204 | void ImGuiInputTextState::CursorAnimReset() { CursorAnim = -0.30f; } // After a user-input the cursor stays on for a while without blinking |
no test coverage detected