Skip to content

Commit

Permalink
Revert "Examples: GLFW: using glfwSetCharModsCallback() to ensure cha…
Browse files Browse the repository at this point in the history
…racters aren't passed when using mods (fix #279)"

This reverts commit d808691.
  • Loading branch information
ocornut committed Aug 20, 2015
1 parent d808691 commit 23ce837
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/opengl3_example/imgui_impl_glfw_gl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ void ImGui_ImplGlfwGL3_KeyCallback(GLFWwindow*, int key, int, int action, int mo
io.KeyAlt = io.KeysDown[GLFW_KEY_LEFT_ALT] || io.KeysDown[GLFW_KEY_RIGHT_ALT];
}

void ImGui_ImplGlfwGL3_CharModsCallback(GLFWwindow*, unsigned int c, int mods)
void ImGui_ImplGlfwGL3_CharCallback(GLFWwindow*, unsigned int c)
{
ImGuiIO& io = ImGui::GetIO();
if ((mods & ~GLFW_MOD_SHIFT) == 0 && c > 0 && c < 0x10000)
if (c > 0 && c < 0x10000)
io.AddInputCharacter((unsigned short)c);
}

Expand Down Expand Up @@ -262,7 +262,7 @@ bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks)
glfwSetMouseButtonCallback(window, ImGui_ImplGlfwGL3_MouseButtonCallback);
glfwSetScrollCallback(window, ImGui_ImplGlfwGL3_ScrollCallback);
glfwSetKeyCallback(window, ImGui_ImplGlfwGL3_KeyCallback);
glfwSetCharModsCallback(window, ImGui_ImplGlfwGL3_CharModsCallback);
glfwSetCharCallback(window, ImGui_ImplGlfwGL3_CharCallback);
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion examples/opengl3_example/imgui_impl_glfw_gl3.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ bool ImGui_ImplGlfwGL3_CreateDeviceObjects();
void ImGui_ImplGlfwGL3_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
void ImGui_ImplGlfwGL3_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
void ImGui_ImplGlfwGL3_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
void ImGui_ImplGlfwGL3_CharModsCallback(GLFWwindow* window, unsigned int c, int mods);
void ImGui_ImplGlfwGL3_CharCallback(GLFWwindow* window, unsigned int c);
6 changes: 3 additions & 3 deletions examples/opengl_example/imgui_impl_glfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ void ImGui_ImplGlFw_KeyCallback(GLFWwindow*, int key, int, int action, int mods)
io.KeyAlt = io.KeysDown[GLFW_KEY_LEFT_ALT] || io.KeysDown[GLFW_KEY_RIGHT_ALT];
}

void ImGui_ImplGlfw_CharModsCallback(GLFWwindow*, unsigned int c, int mods)
void ImGui_ImplGlfw_CharCallback(GLFWwindow*, unsigned int c)
{
ImGuiIO& io = ImGui::GetIO();
if ((mods & ~GLFW_MOD_SHIFT) == 0 && c > 0 && c < 0x10000)
if (c > 0 && c < 0x10000)
io.AddInputCharacter((unsigned short)c);
}

Expand Down Expand Up @@ -207,7 +207,7 @@ bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks)
glfwSetMouseButtonCallback(window, ImGui_ImplGlfw_MouseButtonCallback);
glfwSetScrollCallback(window, ImGui_ImplGlfw_ScrollCallback);
glfwSetKeyCallback(window, ImGui_ImplGlFw_KeyCallback);
glfwSetCharModsCallback(window, ImGui_ImplGlfw_CharModsCallback);
glfwSetCharCallback(window, ImGui_ImplGlfw_CharCallback);
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion examples/opengl_example/imgui_impl_glfw.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ bool ImGui_ImplGlfw_CreateDeviceObjects();
void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
void ImGui_ImplGlFw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
void ImGui_ImplGlfw_CharModsCallback(GLFWwindow* window, unsigned int c, int mods);
void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c);

0 comments on commit 23ce837

Please sign in to comment.