[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] multiple key downs



I am having trouble receiving input from certain keys, after I have other keys 
held down. For example, if I hold down 'w', then I will not be able to 
receive 's' events, but I can receive every other key. There seems to be a 
pattern with keys that are directly above other keys, like 'q' to 'a' and 'e' 
to 'd'.

I am running this on Linux, but I tested on my WinXP machine to verify. On XP, 
I only have a problem if I hold down more than one key first. For instance, 
if I am holding down two keys, then certain keys wont register.

my script:
-------------------------------------------------------------------------
import sys,pygame
from pygame.locals import *

pygame.init()

size = width, height = 400, 300
screen = pygame.display.set_mode(size)

while 1:

 for event in pygame.event.get():  
  if event.type == pygame.QUIT:
   sys.exit()
  elif event.type == KEYDOWN:
   print event.key

-------------------------------------------------------------------------

I couldn't find any info about this in the docs or mail list. Has anyone else 
had issues with this, or is there a better way to catch simultaneous keys?

-austin