Re: python pygame keyboard input
Shlomo Solomon <[email protected]>
| Newsgroups | gmane.linux.region.israel |
|---|---|
| Message-ID | <[email protected]> |
I tried a clean (new) user and got some really strange results. 1 - after setting up a new user, I saw that the LC variables were the same as on existing users - I guess Mageia creates users based on the system-wide locale 2 - I manually changed all the LC variables in the new user to en_US.UTF-8 and the program ran properly. Now comes the weird stuff :) 3 - I changed the LC variables back to he_IL.UTF-8 and the program STILL RAN PROPERLY 4 - I tried manually changing LC variables to en_US.UTF-8 on an existing user but unlike the new user, this time the program did not run properly. So, I can only conclude that although the problem is connected to the locale as you suggested, there's something else going on and I have no idea what. On Tue, 16 Feb 2016 18:32:21 +0200 "E.S. Rosenberg" <[email protected]> wrote: > 2016-02-16 14:59 GMT+02:00 Shlomo Solomon <[email protected]>: > > 1 - On a virtual machine (Mageia 4) the program runs properly > > > > 2 - Python versions on Mageia and PI are 2.7.9 [GCC 4.9.2] > > > > 3 - I tried: > > LC_ALL=en_US.UTF-8 python tst.py and > > LC_ALL=en_GB.UTF-8 python tst.py but still have the same strange > > behaviour with alphabetic characters. > > > > 4 - I'm not sure what you mean by "a virtual console away from xkb > > and ...". The pygame module won't run in a non-graphic environment. > So in that case what about a clean user that doesn't have multiple > keyboard layouts available? > Or maybe even a clean X session with just xterm if you want to be > really extreme, but probably a clean user will be enough? > Regards, > Eliyahu - אליהו > > > > On Sun, 14 Feb 2016 14:04:09 +0200 > > "E.S. Rosenberg" <[email protected]> wrote: > > > >> Did you try changing it? > >> It is pretty clear from those local variables that you have a nice > >> DE sitting on your mageia box customized for Hebrew/English use > >> while the rPI is just a vanilla install (en_GB). > >> Did you try running your python script on a virtual console away > >> from xkb and all the other things aiming to help you with > >> multiple-language input options? > >> Did you try running it while making sure your locale variables are > >> all C/en_US.utf-8? > >> And again are the python versions you are using on each platform > >> matching? > >> > >> 2016-02-14 12:05 GMT+02:00 Shlomo Solomon > >> <[email protected]>: > >> > In response to E.S. Rosenberg's post, here are the locale > >> > variables on my Mageia 5 and Raspberry PI. Although there are > >> > differences, I don't see the problem. The main difference is > >> > that Mageia is set to en_US.UTF-8 and the PI to en_GB.UTF-8. > >> > > >> > There are also differences in variables defining numeric, paper > >> > and others, but they don't seen to be variables that would cause > >> > my text input problem. > >> > > >> > > >> > MAGEIA 5 locale > >> > > >> > LANG=en_US.UTF-8 > >> > LC_CTYPE=en_US.UTF-8 > >> > LC_NUMERIC=he_IL.UTF-8 > >> > LC_TIME=en_US.UTF-8 > >> > LC_COLLATE=en_US.UTF-8 > >> > LC_MONETARY=he_IL.UTF-8 > >> > LC_MESSAGES=en_US.UTF-8 > >> > LC_PAPER=he_IL.UTF-8 > >> > LC_NAME=he_IL.UTF-8 > >> > LC_ADDRESS=he_IL.UTF-8 > >> > LC_TELEPHONE=he_IL.UTF-8 > >> > LC_MEASUREMENT=he_IL.UTF-8 > >> > LC_IDENTIFICATION=he_IL.UTF-8 > >> > LC_ALL= > >> > > >> > RASPBERRY PI locale > >> > > >> > LANG=en_GB.UTF-8 > >> > LANGUAGE= > >> > LC_CTYPE="en_GB.UTF-8" > >> > LC_NUMERIC="en_GB.UTF-8" > >> > LC_TIME="en_GB.UTF-8" > >> > LC_COLLATE="en_GB.UTF-8" > >> > LC_MONETARY="en_GB.UTF-8" > >> > LC_MESSAGES="en_GB.UTF-8" > >> > LC_PAPER="en_GB.UTF-8" > >> > LC_NAME="en_GB.UTF-8" > >> > LC_ADDRESS="en_GB.UTF-8" > >> > LC_TELEPHONE="en_GB.UTF-8" > >> > LC_MEASUREMENT="en_GB.UTF-8" > >> > LC_IDENTIFICATION="en_GB.UTF-8" > >> > LC_ALL= > >> > > >> > > >> > > >> > > >> > > >> > On Sun, 14 Feb 2016 11:28:52 +0200 > >> > "E.S. Rosenberg" <[email protected]> wrote: > >> > > >> >> I think your question shouldn't be what distro but rather: > >> >> - what version of python > >> >> - what localization was set when running the program (LC_* env > >> >> vars) > >> >> > >> >> 2016-02-14 11:17 GMT+02:00 Shlomo Solomon > >> >> <[email protected]>: > >> >> > Meir - thanks. What distro are you running? > >> >> > > >> >> > I can now add that the problem exists on my Mageia 5 and > >> >> > Mageia 4 boxes. But on a Raspberry PI, the program does run > >> >> > as expected. > >> >> > > >> >> > I'd appreciate if someone could test this on Mageia and let me > >> >> > know if this is a Mageia problem, or maybe something wrong > >> >> > with my setup. > >> >> > > >> >> > > >> >> > On Sun, 14 Feb 2016 06:10:36 +0000 > >> >> > Meir Michanie <[email protected]> wrote: > >> >> > > >> >> >> It works for me. > >> >> >> python pykey.py 113 - q 119 - w 101 - e 114 - r 116 - t 121 > >> >> >> - y 116 - t 306 > >> >> >> - left ctrl 99 - c > >> >> >> > >> >> >> On Sun, 14 Feb 2016 at 01:07 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 > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > -- > >> >> >> > 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 > >> >> >> > > >> >> > > >> >> > > >> >> > > >> >> > -- > >> >> > 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 > >> > > >> > > >> > > >> > -- > >> > 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 > > > > > > > > -- > > 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 -- 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