Hi Diliup,
I believe that there is a slight gain in performance when using set_allowed so that only certain events are added to the queue. ÂI have never profiled it, but I doubt that it's terribly more efficient. I would just do the usual method of polling for events each loop, tracking the held keys, and handling them appropriately, and see if that meets your requirements. ÂFor your case, you may not really have to track held keys, and could just run a function to turn tones on if a key pressed, and off when it is released:
while True:
  tslf = fpsClock.tick( FPS )
  for event in pygame.events.get():
    if event.type == KEYDOWN:
      if event.key == K_q:
        play_tone( q )
      elif event.key == K_2:
        play_tone( 2 )
      .....
    elif event.type == KEYUP:
      if event.key == K_q:
        stop_tone( q )
      elif event.key == K_2:
        stop_tone( 2 )
  # draw and update buttons here...
  pygame.display.update()
Thank you,
Noel