>>The built-in Memo Pad app (along with all the other built-ins) 
>>has a neat
>>feature: if it's open, and the user presses a hard button
>>which is assigned
>>to the Memo Pad, it cycles to the next category. I know it's
>>not an event, so
>>how would you trap that?
> It is, kind of.  You catch a keyDownEvent while you're in your
> event loop.  I've posted the source code to do this here:
>
> http://www.escribe.com/computing/pcpqa/m20156.html
>
> You just catch those keyDownEvents fired off by the application
> buttons, and assign them to do whatever function you want (before
> the system can get control of them in your Event handler...thus,
> put the code in the loop before SysHandleEvent( ... ).
>
>>
Actually, if your application is bound to a hard button (user sets it up
that way in Preferences/Buttons), there's no need to catch the keyDownEvent
before the SysHandleEvent.  SysHandleEvent checks a hard button to see
whether the active application is mapped to it.  If it is, it returns false,
and doesn't handle the event.  Thus, you can just check for a hard button
keydown in your form's event handler.  If you get the hard button, that
means you're mapped to the hard button.

That's how the memopad is coded.  Note that if you map the memopad to to
todo button, tapping the todo button will still cycle through the memopad
categories.


Neil

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