Sorry, I didnt get the point.... I dont know any Pygame funtion that gives you the char back that was pressed. I guess you have to program it out, means, you have to check for every single pressed key (what about "shift" + "a", etc.?). This can be very expensive inside a loop when checking ALL key inputs. So its definately smarter and faster to check only the ones you really want to check. In the Pygame doc they write: ... Both events have a key attribute that is a integer id representing every key on the keyboard. ... Thats what it does but as far as I've check it the int value is not compatible to the ASCII values what would have made it easier to create a key check function. Maybe you use a kinda internal value translator between the returned event.key value and the ASCII table values. I've quickly checked key "a" and key "b" from event.key: a = 97 b = 98 They seem to fit the ASCII table list. That way you can directly return the int value converted to ascii value by: chr(event.key) By default the any key input is checked in the event queue, so I dont see any reason why to use poll and pump. If the order of the pressed keys is important (what it normally does) you should use pygame.KEYDOWN and not pygame.key.get_pressed Hope I could help this time Greetings Farai Am 25.10.2006 um 23:55 schrieb Kai Kuehne:
|