You can try a prehandler event function

#define FindButton 266

static void EventLoop(void)
{
static EventType event;
Word error;


do
{
// Get the next available event.
EvtGetEvent(&event, /*5*/ evtWaitForever);
if(!PreHandler(&event))
// Give the system a chance to handle the event.
if( !SysHandleEvent (&event))
if( !MenuHandleEvent (CurrentMenu, &event, &error))
// Give the application a chance to handle the event.
if( !ApplicationHandleEvent(&event) )
// Let the form object provide default handling of the event.
FrmDispatchEvent(&event);
}
while (event.eType != appStopEvent);
}

static Boolean PreHandler(EventPtr event)
{
if((event->eType == keyDownEvent)&&(event->data.keyDown.modifiers & commandKeyMask))
{
if (event->data.keyDown.chr == FindButton)
return(true);
else
return(false);
}

return (false);
}

This will prevent the system to handle the event when the find is pressed.

This is the easiest way to get arround it, if you want the values for the other
buttons like the cradle etc, you could manage them all like that, i have the
codes just let me know


At 08:51 PM 09/16/1999 GMT, you wrote:
>>Folks - I'm writing an application that runs on dedicated Palms. Users are
>>*not* supposed to be able to exit the app without entering a password
>>(obviously resets will bypass anything I can do at this point).
>>
>>I can ignore appStop events, and this works fine for users tapping the
>>applications button, and it'll also keep users from exiting via Find
>>results. I can't stop the find dialog coming up, though, or the finds being
>>executed.
>>
>>Is there a way to do this? I can't think of one.
>
>
>There's probably an easier way, but one way that comes to mind is to test for
>penDown events immediately after you call EvtGetEvent. If it's a penDown, check
>the pen coordinates (they're accurate on penDown, despite my earlier postings
>about incorrect penUp coordinates) - if they're in the range that would activate
>the find button, don't pass the event on to any of the event handlers; just go
>get another event.
>
>in other words:
>
>void EventLoop(void)
>{
> EventType event;
> Word error;
>
> do {
> EvtGetEvent(&event,evtWaitForever);
>
> // here's the magic lines to disable the Find...
> if ((event.eType == penDown) &&
> (event.screenX > 135) &&
> (event.screenY > 190)) {
> continue;
> }
>
> if (!SysHandleEvent(&event))
> if (!MenuHandleEvent(NULL,&event,&error))
> if (!ApplicationHandleEvent(&event))
> FrmDispatchEvent(&event);
> }
> while (event.eType!=appStopEvent);
>}
>
>
>I'm just picking rough coordinates here; you'll have to look for the right
>coordinates that outline the Find button...
>
>- Al -
>
>--
>-- Alan Weiner -- [EMAIL PROTECTED] -- http://www.ajw.com
>
>
>
>
>

Reply via email to