Fix bug where backspace intended for an imgui widget reset the environment

PiperOrigin-RevId: 942496281
Change-Id: I8c5d315d22a7c01dbe69f19833964f25141e9663
This commit is contained in:
Matija Kecman
2026-07-04 07:39:53 -07:00
committed by Copybara-Service
parent c665f0b59e
commit bdc9e9cce3
@@ -188,6 +188,8 @@ def handle_reset_keyboard_events(
model: mujoco.MjModel, data: mujoco.MjData
) -> bool:
"""Handles keyboard shortcuts for simulation reset."""
if imgui.GetIO().WantCaptureKeyboard:
return False
if imgui.IsKeyChordPressed(imgui.Key.Backspace):
if model is not None and data is not None: