> This works great, however the Home button (launchChr) and Calculater button
> (calcChr) can't be disabled. Everytime I call alert form (using
> FrmCustomAlert function), these 2 buttons still work. As a result the
> application is exited.
>
> How do you intercept these 2 keyDownEvents for Home and Calculator buttons
> from exiting application, specifically when you call alert form
> (FrmCustomAlert)?
the home and calculator buttons are not hard buttons - FrmSetMask() only
works on hard buttons. some new devices actually have a hard HOME button.
the home and calc buttons normally generate virtual characters; which,
when intercepted by SysHandleEvent() puts an appStopEvent on the
queue and launches the appropriate application.
you have two ways to solve this:
- never pass the keyEvent to SysHandleEvent
- never allow your application to exit
the first is easy; just filter the event before calling
SysHandleEvent. the second
is even easier; you normally have a while loop somewhere, that says:
do
{
} while (eventType != appStopEvent);
you have 100% control of the device when your app is running; so, if you
choose never to exit; then, your application wont. change the while loop to
say while (true); and you'll find no matter what you do you cannot exit the app
// Aaron Ardiri
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/