[SDL] Mac OS X Keyboard Events Not getting to SDL app in Windowed Mode?
walisser at mac.com
Sun May 16 11:15:27 PDT 2004
> From: Steven Saunders <s_j_nevets at yahoo.com.au>
> Subject: [SDL] Mac OS X Keyboard Events Not getting to SDL app in
> Windowed Mode?
> Hi All,
> I'm trying to compile a couple of different SDL apps (both normally
> compiled in unix environments) using the 1.2.7 SDL framework under
> Mac OS X. I'm using Makefiles, not XCode. The applications seem to
> compile fine, and when run in full-screen mode everything works fine,
> however when run in a window something goes wrong. The window appears
> properly, but it appears behind the Terminal window from which I
> launched the app... and keyboard events still seem to go to that
> Terminal, rather than the SDL application. I've tried clicking on the
> SDL app and it comes to the front, but the title-bar of the window
> doesn't take on the "active application" appearance (the Terminal
> window retains it, even though it is now behind the SDL window) and
> it still doesn't get the keyboard events (they still go to the
> I have noticed that if I bundle the compiled program up into a
> standard MacOSX Application bundle (a ".app") and launch it from the
> Finder everything works properly. This is OK for one of the programs,
> but the other one has command line arguments, so I don't want to be
> launching it from the Finder.
> Do I need to change something in the SDLMain.m file I am using? I'm
> just using the standard one from the "SDL Application" template.
It could be an older version of SDLMain.m that is causing the problem
(there was an issue at one point with keyboard focus that was resolved
over a year ago I believe). Try using the code from cvs (run
./configure; make; make install and link to -lsdl and -sdlmain on the
More information about the SDL