views:

37

answers:

1

Hi guys,

I'm looking to detect the ALT key in PyGame, but every time I press it, it will bring up the menu that you normally get if you click the icon at the upper left of the window (Restore, Maximize, etc).

How do I get PyGame to recognise the keypress, rather than the window?

many thanks

A: 

The only solution i could think of is pygame.event.set_grab(True) to grab all input. http://www.pygame.org/docs/ref/event.html (Check the comments for the keycodes)

I don’t know if this blocks alt+tab and/or multimedia buttons, too, so you should preoceed with caution.

flying sheep