Re: python pygame keyboard input

Shlomi Fish <[email protected]>
Newsgroups gmane.linux.region.israel
Message-ID <CANy4znUZMf2-=GYAqbdfwButxb_Y0CMQfV5NGLNSciR-w2vafg@mail.gmail.com>
Hi Shlomo!

On Sun, Feb 14, 2016 at 1:06 AM, Shlomo Solomon <[email protected]>
wrote:

> 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
>
>
This is working fine for me on Mageia x86-64 v6 on Plasma 5 with this
locale:

shlomif@telaviv1:~$
locale
LANG=en_GB.UTF-8

LC_CTYPE=en_US.UTF-8

LC_NUMERIC=en_GB.UTF-8

LC_TIME=en_GB.UTF-8

LC_COLLATE=en_US.UTF-8

LC_MONETARY=en_US.UTF-8

LC_MESSAGES=en_US.UTF-8

LC_PAPER=en_US.UTF-8

LC_NAME=en_GB.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_ALL=
shlomif@telaviv1:~$

Regards,

-- Shlomi

-- 
------------------------------------------
Shlomi Fish http://www.shlomifish.org/

Chuck Norris helps the gods that help themselves.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

_______________________________________________
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.