title: How do I make two keys respond at the same time?
body: <p>I am currently making a pong game in python:</p>
  
  <p><img src="https://i.stack.imgur.com/mrrAY.png" alt="enter image description here"></p>
  
  <p>However, say the ball is coming at pink, and the yellow guy decides to spam his <code>w</code> and <code>s</code> keys. Then his paddle will start moving (fine), but then the pink one will stop (not fine).</p>
  
  <p>Is it possible for python to listen to two event keys simultaneously?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>import pygame, sys
  from pygame.locals import *
  pygame.init()
  
  DISPLAYSURF = pygame.display.set_mode((1439, 790))
  YELLOW = (255, 255, 0)
  PINK = (255, 0, 255)
  BLUE = (120, 214, 208)
  y1, y2 = (0, 0)
  circx, circy = (1439//2, 790//2)
  diffx, diffy = (15, 15)
  pygame.key.set_repeat(1, 10)
  while True:
          if (0 &lt;= circy &lt;= 780) == False:
                  diffy*=-1
          if circx &lt;= 60 and y1-10 &lt;= circy &lt;= y1+75:
                  diffx*=-1
          if circx &gt;= 1439-60 and y2-10 &lt;= circy &lt;= y2+75:
                  diffx*=-1
          if (0 &lt;= circx &lt;= 1439) == False:
                  circx, circy = (720, 395)
          DISPLAYSURF.fill((0, 0, 0))
          pygame.draw.rect(DISPLAYSURF, YELLOW, (50, y1, 10, 75))
          pygame.draw.rect(DISPLAYSURF, PINK, (1439-60, y2, 10, 75))
          pygame.draw.circle(DISPLAYSURF, BLUE, (circx, circy), 10)
          circx+=diffx
          circy+=diffy
          try:
                  for event in pygame.event.get():
                          if event.type == QUIT or event.key == pygame.K_ESCAPE or event.key == pygame.K_q:
                                  pygame.quit()
                                  sys.exit()
                          if event.key == pygame.K_w:
                                  y1-=15
                          if event.key == pygame.K_s:
                                  y1+=15
                          if event.key == pygame.K_UP:
                                  y2-=15
                          if event.key == pygame.K_DOWN:
                                  y2+=15
          except AttributeError:
                  pass
          pygame.display.flip()
  </code></pre>
  
  <p>How do I make it independently handle each key press if there are 2 simultaneous ones?</p>