Skip to content

Commit 093524a

Browse files
kevinzakkacopybara-github
authored andcommitted
Correctly activate free camera on esc key hit.
PiperOrigin-RevId: 499576860 Change-Id: Ie1544d6efbed34384c6fbfe6784739c93f573095
1 parent ae85a28 commit 093524a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

dm_control/viewer/viewer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def initialize(self, physics, renderer_instance, touchpad):
219219
self._input_map.bind(self._free_camera.set_rotate_mode, _ROTATE_CAMERA)
220220
self._input_map.bind(self._free_camera.center, _CENTER_CAMERA)
221221
self._input_map.bind(self._free_camera.track, _TRACK_OBJECT)
222-
self._input_map.bind(self._free_camera.free_look, _FREE_LOOK)
222+
self._input_map.bind(self._camera_select.escape, _FREE_LOOK)
223223
self._input_map.bind(self._manipulator.select, _SELECT_OBJECT)
224224
self._input_map.bind_plane(self._manipulator.on_move)
225225

@@ -312,6 +312,11 @@ def select_next(self):
312312
self._camera_idx = -1
313313
self._commit_selection()
314314

315+
def escape(self) -> None:
316+
"""Unconditionally switches to the free camera."""
317+
self._camera_idx = -1
318+
self._commit_selection()
319+
315320
def _commit_selection(self):
316321
"""Selects a controller that should go with the selected camera."""
317322
if self._camera_idx < 0:

0 commit comments

Comments
 (0)