python pygame keyboard input

python pygame keyboard input

Shlomo Solomon shlomo.solomon at gmail.com
Sun Feb 14 11:17:04 IST 2016


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 <meirm at riunx.com> 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 <shlomo.solomon at gmail.com>
> 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
> > Linux-il at cs.huji.ac.il
> > 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




More information about the Linux-il mailing list