Various MacOSX questions and bug reports

  • I could swear someone sent a patch to disable screen blanking on MacOSX
    by pushing a fake input event through a queue somewhere, but I can’t find
    it to save my life. Did I dream this, and/or is there a better way to
    handle it?

  • Calling SDL_SetVideoMode() with SDL_FULLSCREEN will leave a second
    monitor on…is there some way to force this second display off? This has
    been generating a lot of “bug” reports in the ut2003 mac demo.

  • Harmon Kardon’s USB SoundSticks seem to report as a joystick. :slight_smile:

I’m willing to patch all three if anyone’s got pointers on what to do.

–ryan.

Message: 20

  • I could swear someone sent a patch to disable screen blanking on
    MacOSX
    by pushing a fake input event through a queue somewhere, but I can’t
    find
    it to save my life. Did I dream this, and/or is there a better way to
    handle it?

I searched several lists at http://search.lists.apple.com/ and didn’t
come up with anything (some Classic-only technique on mac-games-dev and
unanswered question on cocoa-dev). My guess would be synthesizing an
event using the CGRemoteOperation API. Ah, eureka! The folks at #macdev
figured it out (again;-):

http://developer.apple.com/techpubs/macosx/Carbon/utilities/
PowerManager/Power_Manager/01powermanager/function_group_1.html

Looks like you want to call UpdateSystemActivity(UsrActivity)

  • Calling SDL_SetVideoMode() with SDL_FULLSCREEN will leave a second
    monitor on…is there some way to force this second display off? This
    has
    been generating a lot of “bug” reports in the ut2003 mac demo.

Originally, only the main display was captured. This was changed so
that by default, all displays are captured, but if you do
SDL_putenv(“SDL_SINGLEDISPLAY=1”), only the main display is captured.

If what you really mean is to put other displays in energy-saver mode,
I have no clue about that.

  • Harmon Kardon’s USB SoundSticks seem to report as a joystick. :slight_smile:

Looks like an error in the joystick code. We were trying to fix the
problem of keyboards and mice showing up as joysticks:

/* Filter device list to non-keyboard/mouse stuff */
if ( device->usagePage == kHIDPage_GenericDesktop &&
(device->usage == kHIDUsage_GD_Keyboard ||
device->usage == kHIDUsage_GD_Mouse)) {

		/* release memory for the device */
		HIDDisposeDevice (&device);
		DisposePtr((Ptr)device);
		continue;
	}

What it should read is:

/* Filter device list to only joystick/gamepad stuff */
if ( device->usagePage == kHIDPage_GenericDesktop &&
(device->usage != kHIDUsage_GD_Joystick ||
device->usage != kHIDUsage_GD_Gamepad)) {

		/* release memory for the device */
		HIDDisposeDevice (&device);
		DisposePtr((Ptr)device);
		continue;
	}

This will reject all non-gaming devices, but might give false negatives.

I think most devices report the joystick or gamepad usage, but some
might not.

See
/System/Library/Frameworks/Kernel.framework/Headers/IOKit/hid/
IOHIDUsageTables.h for other usage pages.On Wednesday, May 21, 2003, at 12:31 PM, sdl-request at libsdl.org wrote:

Date: Wed, 21 May 2003 03:23:10 -0400 (EDT)
From: “Ryan C. Gordon”
To:
Subject: [SDL] Various MacOSX questions and bug reports…
Reply-To: sdl at libsdl.org

I’m willing to patch all three if anyone’s got pointers on what to do.

–ryan.