"John J. Corelli" wrote:
>
> Hello All -
>
> Digging through the Reference Guide and Companion document that both come
> with Code Warrior, I found the keymgr.h defines for the application hardware
> buttons (the address, calendar, page up, page down etc.). Now I am trying
> to figure out how to trap these events and use these buttons in my
> application (and not kick off their 'defined' apps).
>
> I know that they are somehow trapped in the SysHandleEvent() function within
> the event loop, but I can't find any other documentation or examples of how
> to properly trap these buttons for use by my application/form(s).
>
> Can anybody point me in the direction of where I can find this?
>
> TIA
> John
Just call your ButtonsHandleEvent() function with the incoming event before
you send it to SysHandleEvent(), like so:
EvtGetEvent(&event, evtWaitForever);
if (! ButtonsHandleEvent(&event) ) // grab the buttons before anything
else can
if (! SysHandleEvent(&event))
and in your ButtonsHandleEvent():
switch( eventP->eType ) {
case keyDownEvent:
switch( eventP->data.keyDown.chr ) {
case pageUpChr:
// do stuff
break;
case pageDownChr:
// do stuff
break;
case hard1Chr:
// do stuff
break;
case hard2Chr:
// do stuff
break;
--
Brian Mathis
Direct Edge
http://www.directedge.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/