Keys going to console window under Mac OS X , machO app

Keys going to console window under Mac OS X , machO app …

This is related to my other query posted today. Why would some events go to the console window while resizes and mouse downs are going to the SDL window ?

Any advice would be appreciated.

First, a bit of background. In order to get key events, an app’s window
must be registered with the window server as the "key"
window/application - that which receives keyboard events. Normally, you
double-click the .app bundle, and the underlying application loader
that launches applications takes care of this. Unfortunately, if the
app is not wrapped in a .app bundle, the executable loader will not
do this, and all your keystrokes end up in the program you launched it
from.

So, we devised a fix - in SDLMain.m - which explicitly requests
keyboard focus whenever an SDL application is launched from the
console. The way it determines if the launch came from the console is
by looking at argc/argv. If the launch came from the Finder, the Carbon
process serial number is placed in argv (to see what I mean do a ps -ax
and notice the -psn_* arguments). Otherwise, it came from the console,
and the “make-me-key” hack runs before entering SDL_main.

What’s probably happening in your case is that either:
a) You are using a version of SDLMain.m that is too old, or you are not
using it at all
b) When CodeWarrior launches your program, argv doesn’t have the right
values (perhaps -psn_* is in there) so SDLMain.m doesn’t know to run
the make-me-key hack.On Tuesday, May 27, 2003, at 03:01 PM, sdl-request at libsdl.org wrote:

Message: 12
Date: Tue, 27 May 2003 10:01:45 -0400
From: “Mark Whittemore”
To:
Subject: [SDL] SDL_KEYDOWN and SDL_KEYUP events not generated under
OSX MachO ?
Reply-To: sdl at libsdl.org

SDL_KEYDOWN and SDL_KEYUP events not generated under OSX MachO ?

I’m building an SDL video app with CW8 on OSX and for whatever reason,

I’m not getting any key events. I slightly suspicious that I have =
managed to capture key events with some past incarnation of this machO

app, but I don’t know for sure.=20

I tried enabling these key events specifically using the SDL API but =
still I could not catch any with SDL_PollEvent. I am able to get the =
mousdowns and resize events.

Anyone got any ideas, tips ?

Message: 13
Date: Tue, 27 May 2003 11:57:29 -0400
From: “Mark Whittemore”
To:
Subject: [SDL] Keys going to console window under Mac OS X , machO app

Reply-To: sdl at libsdl.org

Keys going to console window under Mac OS X , machO app …

This is related to my other query posted today. Why would some events
go =
to the console window while resizes and mouse downs are going to the
SDL =
window ?=20

Any advice would be appreciated.