AllenDang/giu

## Reason

gucio321 opened this issue · 1 comments

          ## Reason

in imgui_impl_glfw.cpp:

    glfwSetKeyCallback(vd->Window, ImGui_ImplGlfw_KeyCallback);

in glfw_backend.cpp:

void igGLFWWindow_SetKeyCallback(GLFWwindow *wnd) { glfwSetKeyCallback(wnd, (GLFWkeyfun)keyCallback); }

which is wrapped in glfw_backend.go:

func (b *GLFWBackend) SetKeyCallback(cbfun KeyCallback) {
        b.keyCb = cbfun
        C.igGLFWWindow_SetKeyCallback(b.handle())
}

and in giu we do (in MasterWindow.go):

        w.backend.SetKeyCallback(func(key, scanCode, action, modifier int) {
                fmt.Println(key, scanCode, action, modifier)
                k, m, a := keyFromGLFWKey(imgui.GLFWKey(key)), Modifier(modifier), Action(action)
                handler.Handle(k, m, a)
                if w.additionalInputCallback != nil {
                        w.additionalInputCallback(k, m, a)
                }
        })

conclusion:
we overwrite imgui's internal stuff. This issue should escalate to cimgui-go

Originally posted by @gucio321 in #754 (comment)

well, idk why this is here...
closing as duplicat of #754