MorePalmOS
A development library for developing Palm OS applications

MoreEvent.c File Reference

#include "MorePrefix.h"
#include "MoreEvent.h"
#include "MorePrivate.h"
#include <Chars.h>
#include <Event.h>
#include <SysEvtMgr.h>
#include <MemoryMgr.h>

Include dependency graph for MoreEvent.c:

Include dependency graph

Go to the source code of this file.


Functions

void MEvtPowerOff (MOREPALMOS_NOPARAMS)
 Enqueue an event to trigger the handheld to go to sleep.
void MEvtKeepOn (MOREPALMOS_NOPARAMS)
 Enqueue an event to trigger the handheld to not automatically power down.
void MEvtStopApp (MOREPALMOS_NOPARAMS)
 Enqueue an event to trigger your event loop to stop.

Function Documentation

void MEvtKeepOn MOREPALMOS_NOPARAMS   ) 
 

Enqueue an event to trigger the handheld to not automatically power down.

Uses EvtEnqueueKey to enqueue an event that should trigger the handheld to stay awake. You can use this if you're doing a lot of processing or otherwise don't want the handheld going to sleep.

Notes:

  • In general, interfering with auto sleep is a bad idea. Auto sleep in part protects batterries from being run down prematurely.

Definition at line 35 of file MoreEvent.c.

00036 {
00037         EvtEnqueueKey( vchrResetAutoOff, 0, commandKeyMask );
00038 }

void MEvtPowerOff MOREPALMOS_NOPARAMS   ) 
 

Enqueue an event to trigger the handheld to go to sleep.

Uses EvtEnqueueKey to enqueue an event that should trigger the handheld to got to sleep. Use this instead of SysSleep( ); SysSleep( ) is system use only function that doesn't do what you want.

Definition at line 28 of file MoreEvent.c.

00029 {
00030         EvtEnqueueKey( vchrHardPower, 0, commandKeyMask );
00031 }

void MEvtStopApp MOREPALMOS_NOPARAMS   ) 
 

Enqueue an event to trigger your event loop to stop.

Uses EvtAddEventToQueue to enqueue an event that will cause your event loop to stop processing.

Notes:

  • There may be other events in the queue, and these will still be dealt with before the stop event is reached.

Definition at line 42 of file MoreEvent.c.

00043 {
00044         EventType newEvent;
00045         MemSet( &newEvent, sizeof( newEvent ), 0 );
00046         newEvent.eType = appStopEvent;
00047         EvtAddEventToQueue( &newEvent );
00048 }

SourceForge.net Logo