Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Devices /
Chapter 6 - Power Manager / Power Manager Reference
Power Manager Dispatch Routines / Controlling the Sleep and Wakeup Timers


AutoSleepControl

You can use the AutoSleepControl function to turn the automatic sleep feature on and off.

void AutoSleepControl(Boolean enableSleep);
enableSleep
A Boolean that specifies whether to enable the automatic sleep feature. Set this parameter to true to enable automatic sleep.
DESCRIPTION
The AutoSleepControl function enables or disables the automatic sleep feature that causes the computer to go into sleep mode after a preset period of time. When enableSleep is set to true, the automatic sleep feature is enabled (this is the normal state). When enableSleep is set to false, the computer will not go into the sleep mode unless it is forced to either by some user action--for example, by the user's selecting Sleep from the Special menu of the Finder--or in a low battery situation.

SPECIAL CONSIDERATIONS
Calling AutoSleepControl with enableSleep set to false multiple times increments the auto sleep disable level so that it requires the same number of calls to AutoSleepControl with enableSleep set to true to reenable the auto sleep feature. If more than one piece of software makes this call, auto sleep may not be reenabled when you think it should be.

ASSEMBLY-LANGUAGE INFORMATION
The trap is _PowerMgrDispatch ($A09E). The selector value for AutoSleepControl is 13 ($0D) in the low word of register D0. The Boolean value is passed in the high word of register D0.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996