python pygame keyboard input

Shlomo Solomon <[email protected]>
Newsgroups gmane.linux.region.israel
Message-ID <[email protected]>
I'm having a problem getting text input with pygame. 
Here's a simple program and the results I'm getting. Digits and special
keys work but I'm getting strange results for alphabet keys. 
Any idea what my problem is?


import pygame
pygame.init()
pygame.display.set_mode((100, 100))
while True:
    for event in pygame.event.get():
        if event.type == pygame.KEYDOWN:
	    print event.key, "-", pygame.key.name(event.key) 


When I hit 1, 2, F1, F2, LeftShift, PageDown, a, b the output is:

49 - 1
50 - 2
282 - f1
283 - f2
304 - left shift
281 - page down
249 - world 89
240 - world 80



-- 
Shlomo Solomon
http://the-solomons.net
Sent by Claws Mail 3.11.1 - KDE 4.14.5 - LINUX Mageia 5


_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.