Skip to content

Commit fc8c6a9

Browse files
committed
DPL GUI: fix issues with backspace
Move to use the new ImGUI API for keys / mouse events.
1 parent b8fa51e commit fc8c6a9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Framework/GUISupport/src/FrameworkGUIDebugger.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,22 +1216,22 @@ std::function<void(void)> getGUIDebugger(std::vector<DeviceInfo> const& infos,
12161216
void updateMousePos(float x, float y)
12171217
{
12181218
ImGuiIO& io = ImGui::GetIO();
1219-
io.MousePos = ImVec2(x, y);
1219+
io.AddMousePosEvent(x, y);
12201220
}
12211221

12221222
void updateMouseButton(bool clicked)
12231223
{
12241224
ImGuiIO& io = ImGui::GetIO();
1225-
io.MouseDown[0] = clicked;
1225+
io.AddMouseButtonEvent(0, clicked);
12261226
}
12271227

12281228
void updateMouseWheel(int direction)
12291229
{
12301230
ImGuiIO& io = ImGui::GetIO();
12311231
if (direction > 0) {
1232-
io.MouseWheel++;
1232+
io.AddMouseWheelEvent(0, 1.0);
12331233
} else {
1234-
io.MouseWheel--;
1234+
io.AddMouseWheelEvent(0, -1.0);
12351235
}
12361236
}
12371237

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

12501250
void keyUp(char key)
12511251
{
12521252
ImGuiIO& io = ImGui::GetIO();
1253-
io.KeysDown[io.KeyMap[(int)key]] = false;
1253+
io.AddKeyEvent((ImGuiKey)key, false);
12541254
}
12551255

12561256
void charIn(char key)

0 commit comments

Comments
 (0)