mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 09:35:09 +02:00
ImGui: Implement cursor support on Windows
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include "Common/Input/KeyCodes.h"
|
||||
#include "Common/Thread/ThreadUtil.h"
|
||||
#include "Common/Data/Encoding/Utf8.h"
|
||||
#include "ext/imgui/imgui_impl_platform.h"
|
||||
|
||||
#include "Core/Core.h"
|
||||
#include "Core/Config.h"
|
||||
@@ -611,6 +612,31 @@ namespace MainWindow
|
||||
case WM_SETFOCUS:
|
||||
break;
|
||||
|
||||
case WM_SETCURSOR:
|
||||
if ((lParam & 0xFFFF) == HTCLIENT && g_Config.bShowImDebugger) {
|
||||
LPTSTR win32_cursor = 0;
|
||||
switch (ImGui_ImplPlatform_GetCursor()) {
|
||||
case ImGuiMouseCursor_Arrow: win32_cursor = IDC_ARROW; break;
|
||||
case ImGuiMouseCursor_TextInput: win32_cursor = IDC_IBEAM; break;
|
||||
case ImGuiMouseCursor_ResizeAll: win32_cursor = IDC_SIZEALL; break;
|
||||
case ImGuiMouseCursor_ResizeEW: win32_cursor = IDC_SIZEWE; break;
|
||||
case ImGuiMouseCursor_ResizeNS: win32_cursor = IDC_SIZENS; break;
|
||||
case ImGuiMouseCursor_ResizeNESW: win32_cursor = IDC_SIZENESW; break;
|
||||
case ImGuiMouseCursor_ResizeNWSE: win32_cursor = IDC_SIZENWSE; break;
|
||||
case ImGuiMouseCursor_Hand: win32_cursor = IDC_HAND; break;
|
||||
case ImGuiMouseCursor_NotAllowed: win32_cursor = IDC_NO; break;
|
||||
}
|
||||
if (win32_cursor) {
|
||||
SetCursor(::LoadCursor(nullptr, win32_cursor));
|
||||
} else {
|
||||
SetCursor(nullptr);
|
||||
}
|
||||
return TRUE;
|
||||
} else {
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
if (firstErase) {
|
||||
firstErase = false;
|
||||
|
||||
Reference in New Issue
Block a user