Skip to content

Commit 1b6b860

Browse files
stuartcarnieocornut
authored andcommitted
Backends: OSX: Fix keyboard support. Handle scroll cancel. Don't set mouse cursor shape unconditionally. (#4759, #4253, #1873)
Note the original FIXME: refered to GLFWs Cocoa implementation, which is largely what this commit provides.
1 parent f71ee52 commit 1b6b860

File tree

5 files changed

+212
-101
lines changed

5 files changed

+212
-101
lines changed

backends/imgui_impl_osx.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
77
// [X] Platform: OSX clipboard is supported within core Dear ImGui (no specific code in this backend).
88
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
9-
// Issues:
10-
// [ ] Platform: Keys are all generally very broken. Best using [event keycode] and not [event characters]..
9+
// [X] Platform: Keyboard arrays indexed using kVK_* codes, e.g. ImGui::IsKeyPressed(kVK_Space).
1110

12-
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
11+
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
1312
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
1413
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
1514
// Read online: https://github.com/ocornut/imgui/tree/master/docs
@@ -19,7 +18,7 @@
1918
@class NSEvent;
2019
@class NSView;
2120

22-
IMGUI_IMPL_API bool ImGui_ImplOSX_Init();
21+
IMGUI_IMPL_API bool ImGui_ImplOSX_Init(NSView* _Nonnull view);
2322
IMGUI_IMPL_API void ImGui_ImplOSX_Shutdown();
2423
IMGUI_IMPL_API void ImGui_ImplOSX_NewFrame(NSView* _Nullable view);
2524
IMGUI_IMPL_API bool ImGui_ImplOSX_HandleEvent(NSEvent* _Nonnull event, NSView* _Nullable view);

0 commit comments

Comments
 (0)