Hi,
thanks for your help !
I tried it but ... when I want to run it now, there's a Link Error:
"myapp.c: 'AppEventLoop' 16-bit code reference to 'TrapHardwareButtons' is
out of range"
What's wrong with my function ? Am I not allowed to call a function in
AppEventLoop ?
Thanks for your help !
_____
PE|RA
here's my code:
-----------------------------------------------------------------------
void AppEventLoop(void)
{
UInt16 error;
EventType event;
Boolean bNormalWork = true;
do {
EvtSetNullEventTick(1);
EvtGetEvent(&event, 1);
bNormalWork = TrapHardwareButtons(&event);
if (bNormalWork)
{
if (! SysHandleEvent(&event))
if (! MenuHandleEvent(0, &event, &error))
if (! AppHandleEvent(&event))
FrmDispatchEvent(&event);
}
bNormalWork = true;
} while (event.eType != appStopEvent);
}
-----------------------------------------------------------------------
Boolean TrapHardwareButtons(EventPtr event)
{
Boolean bNormalWork = true;
if ((event->eType == keyDownEvent) && (event->data.keyDown.modifiers &
commandKeyMask))
{
switch (event->data.keyDown.chr)
{
case hardCradleChr:
// HotSync
FrmCustomAlert(UserInfoAlert,sERRORTEXT_1,NULL, NULL);
bNormalWork = false;
break;
case hardCradle2Chr:
// HotSync
FrmCustomAlert(UserInfoAlert,sERRORTEXT_1,NULL, NULL);
bNormalWork = false;
break;
case hard1Chr:
// Button 1
bNormalWork = false;
break;
case hard2Chr:
// Button 2
bNormalWork = false;
break;
case hard3Chr:
// Button 3
bNormalWork = false;
break;
case hard4Chr:
// Button 4
bNormalWork = false;
break;
default:
break;
}
}
return bNormalWork;
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/