class_docstr: Render trajectory data with the possibility to browse back and forward through the episode steps using keyboard.
  
  This is the simplest form of interactive rendering of episode trajectory, useful for example when rendering
  the trajectory ad hoc while the environment is still running. For more comfortable rendering of trajectory
  data inside of a Jupyter Notebook, use :class:`~.notebook_trajectory_viewer.NotebookTrajectoryViewer`.
  
  Note:
  
  The keyboard controls might not work well when run outside of terminal.
  
  If running this through PyCharm, the "Emulate terminal in output console" options in Run/Debug configurations
  needs to be set to true, otherwise the keys will not be picked up correctly and this run loop will crash.
  
  Also, the console needs to be active dor the keys to be picked up.
code: def _print_step_and_render(self):
      if (
          self.step_index
          == 0
          == len(self.episode_record.step_records) - 1
      ):
          suffix = "(the only step in episode)"
      elif self.step_index == 0:
          suffix = "(beginning of episode)    "
      elif self.step_index == len(self.episode_record.step_records) - 1:
          suffix = "(end of episode)          "
      else:
          suffix = "                          "
      print(f"Current step: {self.step_index} {suffix}", end="\r")
  
      step_record = self.episode_record.step_records[self.step_index]
      self.renderer.render(
          maze_state=step_record.maze_state,
          maze_action=step_record.maze_action,
          events=step_record.step_event_log,
          **self.renderer_kwargs,
      )
  
file_path: maze/maze/core/rendering/keyboard_controlled_trajectory_viewer.py
imports: from typing import Dict, Any
  from maze.core.rendering.renderer import Renderer
  from maze.core.trajectory_recording.records.trajectory_record import StateTrajectoryRecord
label_desc: Use image node_id 5 for calling the KeyboardControlledTrajectoryViewer obj's underlying member method code with example usage: obj._print_step_and_render() without return types