[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Problem with simultaneous key presses
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Problem with simultaneous key presses
- From: B W <stabbingfinger@xxxxxxxxx>
- Date: Mon, 8 Feb 2010 23:14:40 -0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Tue, 09 Feb 2010 02:14:51 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=xoYQKqU1E3JGNZ6hjC26iF83/4P+CDFysFz4Lu96Fag=; b=OGz4tNLQUTv46PYbBMD/s+ONoY8ld5970eTAzaAR7vzZgzEChZk3RZ5Ty7mVPYUwlR Pr17oJ8M2yYBj1jYyFglRlNTsqf3zUhKgj/9PQuS2+efWifOowoRDBBgA7qszMjT39oL fP6y0tk7jjD8nxE1xqWPhdsXb6GJdayLPZY4c=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=cQguvjKIgouCftrU8oI8+qCPfKZEz7xBmunFxrr+GgvLnxYpiIl3TCjabxLNQXDE2E h8K81Xg/G1PnUg8/1fsjr6njKd7z0XvHp9K3MbBekMcNbuTaoWLtjgm7IrPQ1VPEvdsU yHJHKkoI8Xb1bjoQQU6djk6h8NfYsa75pFRoE=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Howdy, folks.
The following small program demonstrates a problem with key presses.
http://trollsouttaluckland.googlecode.com/files/test.py
The program accepts cursor keys and space key to simulate moving and firing, respectively. It accumulates keydown and keyup events, translating combinations into diagonal movement. If you press up+left, for example, the box moves diagonally upward and left. This works as intended.
Theoretically you can also fire the ray while moving. However, while moving diagonally this only sometimes works. If for example I press space while holding down up+left, the space key event is sometimes lost or blocked. I can't tell which. But the result is that sometimes while moving diagonally the ray "fires" and sometimes it does not.
This occurs on Windows XP, Python 2.5.4, Pygame 1.9.1release-svn2575. I've also seen it in Pygame 1.8.1.
Does anyone have some insight on this odd behavior? Thanks in advance. :)
Gumm