[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] confusing documentation
- To: <pygame-users@xxxxxxxx>
- Subject: Re: [pygame] confusing documentation
- From: "luke" <rabidpoobear@xxxxxxxxx>
- Date: Tue, 23 Aug 2005 23:34:26 -0500
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Wed, 24 Aug 2005 00:35:04 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:from:to:references:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; b=Hu8QKBWwnHGj6azyle8+VGttG1t/RdWGkd3uHWBGO0yGxOWaa5r1ad2wUi7ZJ0UQg1cGNooBLZK63wvJR1fmqRYPqHkfnnF1S/tx7ZCgp58KYzCSDcu35UKVTM+8gJ9cpjFj2AD+tguzXXKiK7Xfq6fONtkH0HxvJdtCDPHOv7k=
- References: <1124838472.3992.24.camel@localhost> <430BE266.20106@xepher.net>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
----- Original Message -----
From: "Kris Schnee" <kschnee@xxxxxxxxxx>
To: <pygame-users@xxxxxxxx>
Sent: Tuesday, August 23, 2005 9:58 PM
Subject: Re: [pygame] confusing documentation
Ivo Danihelka wrote:
Hi,
Pygame documentation suggests to call
pygame.event.get([KEYDOWN,KEYUP]) to get all
the keyboard events.
This is not always the right way, because the other events will remain
in the queue. SDL queue could contain max 128 unprocessed events,
additional events will be ignored.
The right way is to get all events by
pygame.event.get() or some other way.
Couldn't you call pygame.event.get([KEYDOWN,KEYUP]) to get just the
types of events you care about, and then -- what is it --
pygame.event.clear() [?] to flush out the unwanted ones? This would
prevent an overflow and save you from having to deal with every event.
Kris
for event in pygame.event.get():
if event in [KEYDOWN,KEYUP]:
what's wrong with this?
(untested, you get the general idea i hope)
except having to indent everything more :-\