File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -96,13 +96,13 @@ - (void)keyDown:(NSEvent *)event {
96
96
- (void )insertText : (id )aString replacementRange : (NSRange )replacementRange
97
97
{
98
98
ImGuiIO& io = ImGui::GetIO ();
99
-
99
+
100
100
NSString *characters;
101
101
if ([aString isKindOfClass: [NSAttributedString class ]])
102
102
characters = [aString string ];
103
103
else
104
104
characters = (NSString *)aString;
105
-
105
+
106
106
io.AddInputCharactersUTF8 (characters.UTF8String );
107
107
}
108
108
@@ -271,7 +271,7 @@ bool ImGui_ImplOSX_Init(NSView *view)
271
271
selector: @selector (onApplicationBecomeInactive: )
272
272
name: NSApplicationDidResignActiveNotification
273
273
object: nil ];
274
-
274
+
275
275
g_KeyEventResponder = [[KeyEventResponder alloc ] initWithFrame: NSZeroRect ];
276
276
[view addSubview: g_KeyEventResponder];
277
277
@@ -309,8 +309,13 @@ static void ImGui_ImplOSX_UpdateMouseCursorAndButtons()
309
309
}
310
310
else
311
311
{
312
+ NSCursor *desired = g_MouseCursors[imgui_cursor] ?: g_MouseCursors[ImGuiMouseCursor_Arrow];
312
313
// Show OS mouse cursor
313
- [g_MouseCursors[g_MouseCursors[imgui_cursor] ? imgui_cursor : ImGuiMouseCursor_Arrow] set ];
314
+ if (desired != NSCursor .currentCursor )
315
+ {
316
+ [desired set ];
317
+ }
318
+ // [g_MouseCursors[g_MouseCursors[imgui_cursor] ? imgui_cursor : ImGuiMouseCursor_Arrow] set];
314
319
if (g_MouseCursorHidden)
315
320
{
316
321
g_MouseCursorHidden = false ;
You can’t perform that action at this time.
0 commit comments