[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] How to get capital letters from key event
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] How to get capital letters from key event
- From: Knapp <magick.crow@xxxxxxxxx>
- Date: Thu, 1 Dec 2005 15:29:02 -0800
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Thu, 01 Dec 2005 18:29:06 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nNbh7htLLxVTn5pPEULTvTu4gS+DcLmzoRSWMfZ8LN1Px17e2KzSgyowAGLSmyukPJSr4yVqQqU+Q0aWmMU/xsIxHBIDd+mJ5Sb3DKND0xugQpxcJYIjlfuXVMhQOV4X+000l2kxKXVRi6qG7P7Z5OkRRelJQskw2xKDKAa++jk=
- In-reply-to: <20051201231711.GD7822@asu.edu>
- References: <f495db580511291756j4a7ae797hb0957763c0cb2542@mail.gmail.com> <383b6d6f0511292354g10285f4cidec1fae246a933a8@mail.gmail.com> <438DA62C.7000904@softwave.se> <1133366099.10529.14.camel@localhost.localdomain> <f495db580511300934x4171ace7w93cbc8995bef5062@mail.gmail.com> <438DEBFF.4030804@softwave.se> <f495db580511301047t4f4f29a1hcc7577228582cc20@mail.gmail.com> <f495db580511301111m31838c10pf1bfc225c3c3a601@mail.gmail.com> <1133478714.14780.3.camel@localhost.homelan> <20051201231711.GD7822@asu.edu>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Or like this.
for e in pygame.event.get(): #set eventstates of keys and mouse to dictionary
if e.type == QUIT: return # keys that stop the program
if e.type == KEYDOWN :#may draw if it is a function key
eventstates[e.key]=True
if eventstates[K_RSHIFT]==True : # if Right shift key pressed then
if eventstates[K_ESCAPE]== True : return #quit program
> I am implementing a TextLabel widget with pygame but I can't get capital
> letters. I get the name of pressed key with pygame.key.name(event.key),
> but when I pressed Shift+<letter> I do not get I expect.
>
> Do have I use a FIFO ?