MacOS question

Somebody suggested that SDL apps do not prompt for command line arguments
unless they were started with the option key held down. It sounds like a
good idea to me, so…

How do you detect whether or not the app has been started with the
option key?

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

How do you detect whether or not the app has been started with the
option key?

This works for me:

Boolean OptionKeyIsDown(void)
{
KeyMap theKeyMap;

GetKeys(theKeyMap);

if (((unsigned char *) theKeyMap)[7] & 0x04)
{
	return(true);
}

else
{
	return(false);
}

}

I seem to recall that this may be dependent on a US keyboard layout,
thought I could easily be wrong. I haven’t looked at that stuff for ages.

-Roy

Nope, the virtual keycode for the option key is always the same.

Matt–
/* Matt Slot, Bitwise Operator * One box, two box, yellow box, blue box *

Nope, the virtual keycode for the option key is always the same.

So, in order to see if your application was started with the option key
held down (as in Quake and UT?) is to use the posted code snippet?

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

In article , sdl at lokigames.com wrote:

Nope, the virtual keycode for the option key is always the same.

So, in order to see if your application was started with the option key
held down (as in Quake and UT?) is to use the posted code snippet?

Correct.–
/* Matt Slot, Bitwise Operator * One box, two box, yellow box, blue box *