class_docstr: Wraps an environment allowing keyboard inputs to interact with the environment.
class_docstr_tok: ["Wraps","an","environment","allowing","keyboard","inputs","to","interact","with","the","environment","."]
docstr: Processes a PyGame event.
  
  In particular, this function is used to keep track of which buttons are currently pressed
  and to exit the :func:`play` function when the PyGame window is closed.
  
  Args:
      event: The event to process
docstr_tok: ["Processes","a","PyGame","event",".","In","particular",",","this","function","is","used","to","keep","track","of","which","buttons","are","currently","pressed","and","to","exit","the",":","func",":","`","play","`","function","when","the","PyGame","window","is","closed",".","Args",":","event",":","The","event","to","process"]
code: def process_event(self, event: Event):
      """Processes a PyGame event.
  
      In particular, this function is used to keep track of which buttons are currently pressed
      and to exit the :func:`play` function when the PyGame window is closed.
  
      Args:
          event: The event to process
      """
      if event.type == pygame.KEYDOWN:
          if event.key in self.relevant_keys:
              self.pressed_keys.append(event.key)
          elif event.key == pygame.K_ESCAPE:
              self.running = False
      elif event.type == pygame.KEYUP:
          if event.key in self.relevant_keys:
              self.pressed_keys.remove(event.key)
      elif event.type == pygame.QUIT:
          self.running = False
      elif event.type == VIDEORESIZE:
          self.video_size = event.size
          self.screen = pygame.display.set_mode(self.video_size)
  
file_path: gym/gym/utils/play.py
imports: from collections import deque
  from typing import Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import gym.error
  from gym import Env, logger
  from gym.core import ActType, ObsType
  from gym.error import DependencyNotInstalled
  from gym.logger import deprecation
label_desc: Use image node_id 4 for calling the PlayableGame obj's underlying member method code with example usage: obj.process_event(event) without return types