3

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

RedCap
  • 61
  • 1
  • 3

1 Answers1

0

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
  • 8,475
  • 5
  • 56
  • 73
  • Thanks, it played up when I tried it - messed around with the mouse. Looks like it is not very easy to use the ALT key under PyGame :( – RedCap Nov 02 '10 at 02:30