Skip to content

Commit

Permalink
DPL GUI: fix issues with backspace
Browse files Browse the repository at this point in the history
Move to use the new ImGUI API for keys / mouse events.
  • Loading branch information
ktf committed Mar 25, 2024
1 parent b8fa51e commit 4907830
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Framework/GUISupport/src/FrameworkGUIDebugger.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1216,22 +1216,22 @@ std::function<void(void)> getGUIDebugger(std::vector<DeviceInfo> const& infos,
void updateMousePos(float x, float y)
{
ImGuiIO& io = ImGui::GetIO();
io.MousePos = ImVec2(x, y);
io.AddMousePosEvent(x, y);
}

void updateMouseButton(bool clicked)
{
ImGuiIO& io = ImGui::GetIO();
io.MouseDown[0] = clicked;
io.AddMouseButtonEvent(0, clicked);
}

void updateMouseWheel(int direction)
{
ImGuiIO& io = ImGui::GetIO();
if (direction > 0) {
io.MouseWheel++;
io.AddMouseWheelEvent(0, 1.0);
} else {
io.MouseWheel--;
io.AddMouseWheelEvent(0, -1.0);
}
}

Expand All @@ -1244,13 +1244,13 @@ void updateWindowSize(int x, int y)
void keyDown(char key)
{
ImGuiIO& io = ImGui::GetIO();
io.KeysDown[io.KeyMap[(int)key]] = true;
io.AddKeyEvent((ImGuiKey)key , true);
}

void keyUp(char key)
{
ImGuiIO& io = ImGui::GetIO();
io.KeysDown[io.KeyMap[(int)key]] = false;
io.AddKeyEvent((ImGuiKey)key , false);
}

void charIn(char key)
Expand Down

0 comments on commit 4907830

Please sign in to comment.