#define PowerButton     keyBitPower


DWord hardKeyState = KeyCurrentState( ) & ( PowerButton );
if( hardKeyState == PowerButton )
{
        do your processing
}

Try sticking that in right after your EvtGetEvent and before your
SysHandleEvent in your event loop.  It goes without saying that you
need to take a little extra care when dealing with the power button...
users like to be able to turn their Palms off.  =)

-Rus

>Thanks Rus.  Upon furthur testing I discovered that my test of
>.modifiers for powerOnKeyMask has been working "all along" for the
>case when the application hard key is pressed to awaken the device,
>but not for the case where the power hard key is pressed.  I tried
>also checking .chr for vchrHardPower, but that did not seem to work.
>Do I need to change the key mask with the KeyMgr?  If so, it is not
>clear to me from the documentation what the argument to KeySetMask
>needs to be in order to add the power key to the existing set of
>key events.
>
>Alex
>
>-- 
>For information on using the Palm Developer Forums, or to 
>unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
>

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to