title: Moving text on the screen using pygame keyboard
body: <p>I am trying to move text on the left or right of the screen using the keyboard arrows but could not get it to work. My code is:</p>
  
  <pre><code>while True :
  
      font = pygame.font.SysFont("Times New Roman", 20) # Font type # Font style 
      frame = pygame.display.set_mode ((Renderer.CANVAS_WIDTH, Renderer.CANVAS_HEIGHT))
  
      frame.fill ((49,33,148))
  
      for event in pygame.event.get ():
          if event.type == QUIT :
              pygame.quit ()
              sys.exit    ()
  
          if event.type == pygame.KEYDOWN :
  
                  f = pygame.font.SysFont("Times New Roman", 20) # Font type # Font style 
                  Track = font.render("Track : ", True, (255,255,0) )
  
  
  
      Game ()
      pygame.draw.rect(frame, (30,21,95),(50,400,700,170)) # draw a blue box on the screen 
      Track = font.render("Track : ", True, (255,255,0) )
      frame.blit(Track,(80,410))
  
      Labs = font.render ("Labs :", True, (255,255,0))
      frame.blit(Labs,(80,440))
  
      Distance = font.render ("Distance :", True, (255,255,0))
      frame.blit(Distance,(80,480))
  
  
      pygame.display.update ()  # Update the screen 
  
  
  
  
  
  
  pygame.quit ()
  quit ()
  </code></pre>