A pygame window created using the code below on OS X using the latest pygame source:
import pygame pygame.init() screen = pygame.display.set_mode((640, 480)) done = False while not done: pygame.event.pump() keys = pygame.key.get_pressed() if keys[pygame.K_ESCAPE]: done = True if keys[pygame.K_SPACE]: print("got here") events = pygame.event.get() for event in events: if event.type == pygame.MOUSEBUTTONDOWN: print("mouse at ", event.pos)
does not receive any keyboard input. It is not possible to trigger the "got here" message nor cause it to terminate using Escape; instead all keypresses show up in the terminal window from which the script was run. This happens even though the window appears to have focus.
Additionally, based on the mouse event handling, the window exhibits some combination of the incorrect mouse behavior described in these two issues: https://bitbucket.org/pygame/pygame/issue/79/pygame-incompatible-with-osx-lion-trackpad https://bitbucket.org/pygame/pygame/issue/163/no-mouse-move-events-unless-mouse-button viz. all subsequent clicks register with the same position as the first one, and the only way to update its position is to click and drag to a new location.