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

[pygame] osx (mavericks) keyboard focus



Is there a trick for getting pygame to take the keyboard focus under
osx? I'm trying to port an app from linux and ran into something odd.
This simple program:

import pygame
pygame.init()
screen = pygame.display.set_mode((100,100))
while 1:
        pygame.event.pump()
        if pygame.key.get_pressed()[pygame.K_ESCAPE]:
                break

doesn't work under osx (python 2.7 & pygame 1.9.1 via fink). The
pygame window appears and changes color when clicked indicating it has
the focus (and pygame.key.get_focused returns 1), but clicks in the
pygame window are directed to the terminal where the program was run
from (get_pressed() is always all zeros).

Am I missing something obvious here? This works fine under linux. An
hours or so of googling seems to indicate others have had this
problem, but there's no obvious answer and nothing recent.

thanks,
/jamie

-- 
James Mazer
Department of Neurobiology
Yale School of Medicine
phone: 203-737-5853
fax: 203-785-5263
url: http://jackknife.med.yale.edu