| 197 | } |
| 198 | |
| 199 | static bool ImGui_ImplWin32_UpdateMouseCursor() |
| 200 | { |
| 201 | ImGuiIO& io = ImGui::GetIO(); |
| 202 | if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) |
| 203 | return false; |
| 204 | |
| 205 | ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor(); |
| 206 | if (imgui_cursor == ImGuiMouseCursor_None || io.MouseDrawCursor) |
| 207 | { |
| 208 | // Hide OS mouse cursor if imgui is drawing it or if it wants no cursor |
| 209 | ::SetCursor(nullptr); |
| 210 | } |
| 211 | else |
| 212 | { |
| 213 | // Show OS mouse cursor |
| 214 | LPTSTR win32_cursor = IDC_ARROW; |
| 215 | switch (imgui_cursor) |
| 216 | { |
| 217 | case ImGuiMouseCursor_Arrow: win32_cursor = IDC_ARROW; break; |
| 218 | case ImGuiMouseCursor_TextInput: win32_cursor = IDC_IBEAM; break; |
| 219 | case ImGuiMouseCursor_ResizeAll: win32_cursor = IDC_SIZEALL; break; |
| 220 | case ImGuiMouseCursor_ResizeEW: win32_cursor = IDC_SIZEWE; break; |
| 221 | case ImGuiMouseCursor_ResizeNS: win32_cursor = IDC_SIZENS; break; |
| 222 | case ImGuiMouseCursor_ResizeNESW: win32_cursor = IDC_SIZENESW; break; |
| 223 | case ImGuiMouseCursor_ResizeNWSE: win32_cursor = IDC_SIZENWSE; break; |
| 224 | case ImGuiMouseCursor_Hand: win32_cursor = IDC_HAND; break; |
| 225 | case ImGuiMouseCursor_NotAllowed: win32_cursor = IDC_NO; break; |
| 226 | } |
| 227 | ::SetCursor(::LoadCursor(nullptr, win32_cursor)); |
| 228 | } |
| 229 | return true; |
| 230 | } |
| 231 | |
| 232 | static bool IsVkDown(int vk) |
| 233 | { |
no outgoing calls
no test coverage detected