Hi,

I have an application that registers for the sysNotifyLateWakeupEvent
notification. When the notification is received, some information is
displayed to the user. I have some code to handle the case where the user
turns on his handheld via one of the application buttons, as opposed to via
the power button. The code looks something like this:

case sysAppLaunchCmdNotify:
   if (((SysNotifyParamType *) cmdPBP)->notifyType ==
sysNotifyLateWakeupEvent) {
      Boolean        queued_event = EvtSysEventAvail(false);
      EventType      event;

      if (queued_event) EvtGetEvent(&event, 0);
      handle_notification(cmdPBP, launchFlags);
      ((SysNotifyParamType *) cmdPBP)->handled = true;
      if (queued_event) EvtAddEventToQueue(&event);
      }
   break;

The idea is that if the user pressed an application button, there will be a
keydown event in the queue. If there is such an event, I save it, handle the
notification, put the event back on the queue and continue. This way, if the
user presses, for example, the Datebook button, my application shows the
desired information, puts the event back on the queue, which then causes a
switch to the Datebook application. This seems to be working perfectly on
all devices >= OS 3.5 and in the emulator.

In the simulator, everything also works as it should when one of the four
application buttons is pressed. But, in the simulator, if I turn on the
device via the power button, something flashes for a second and then I get
the black screen that says "This device was powered off". If I press the
power button AGAIN, my application comes up as it should.

Is there something going on that will be a problem in OS 5 so that I will
need to eventually fix this? Or is this just some quirk of the simulator
that won't happen on an actual device? If I do need to fix it, what do I
need to do differently?

Thanks in advance!

Tom


-- 
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