diff --git a/controller/main.py b/controller/main.py index 479eb50..3211d05 100644 --- a/controller/main.py +++ b/controller/main.py @@ -71,6 +71,12 @@ class RobomasterUI: master.bind("", lambda event: self.chassis_move_arrow(z=0) if event.keysym == 'q' else None) master.bind("", lambda event: self.chassis_move_arrow(z=0) if event.keysym == 'e' else None) master.bind("", lambda event: self.stop_chassis()) + master.bind("", self.deselect_textbox) + + def deselect_textbox(self, event): + focused_widget = self.master.focus_get() + if isinstance(focused_widget, tk.Entry) and event.widget != focused_widget: + self.master.focus_set() def _run_command(self, func, *args, **kwargs): self._command_executor(func, *args, **kwargs)