[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] BUG: display.init() confuses key mods



get_pressed also reports the incorrect value.  I think this is either a pygame or SDL issue. 

However, I found that if I use
pygame.key.set_mods(0)
to reset the keyboard mods, that appears to fix the issue for the most part.  Kind of a hack though...

Phil

Luke Paireepinart <rabidpoobear@xxxxxxxxx> wrote:
Phil Hassey wrote:
> Hi,
>
> I noticed that when I used the sample:
>
> http://www.pygame.org/wiki/toggle_fullscreen?parent=CookBook
>
> To control my fullscreen toggling, after I went into full screen, I
> could often just press enter (without the ALT) to get back to windowed
> mode. After some playing around, it appears that either pygame or SDL
> misses the ALT key-up event while switching into fullscreen mode... I
> was able to reproduce this issue on both a linux and win32 system.
>
> Any suggestions? Am I doing something wrong in my toggle_fullscreen code?
if you're using a separate variable to hold the state of the ALT key,
you could just
reset it to false whenever someone goes fullscreen,
and then do a get_pressed or whatever to find out if alt actually still
is pressed
once you're fullscreened.
>
> Thanks!
> Phil
>
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail Beta.
>




Get your email and more, right on the new Yahoo.com