Ralf, Thanks for the response but looks like I misled you by not giving the complete EventLoop code, I am filtering these events out and not passing them to the SysHandleEvent(). Here is my EventLoop function -
void EventLoop() { EventType event; do { EvtGetEvent( &event, 2000 ); if(( ERROR_CHECK_LEVEL == ERROR_CHECK_FULL ) && ( event.eType == keyDownEvent ) && ( event.data.keyDown.chr == keyboardChr ) && ( romVersion >= sysMakeROMVersion( 3,0,0,0,0 )) && ( SysGremlins( GremlinIsOn, 0 ))) { // ignore [abc] and [123] when running Gremlins } if ((event.eType==keyDownEvent) && (event.data.keyDown.chr==vchrContrast) || (event.data.keyDown.chr==vchrBrightness)) { // ... } else if( not SysHandleEvent( &event )) { Word ignore; if( not MenuHandleEvent( 0, &event, &ignore )) { if( event.eType == frmLoadEvent ) { const Word formID = event.data.frmLoad.formID; FormPtr form = FrmInitForm( formID ); FrmSetActiveForm( form ); FrmSetEventHandler( form, GetEventHandler( formID )); } else { FrmDispatchEvent( &event ); } } } }while( event.eType != appStopEvent ); } But the problem is that it works when we have a regular form on the screen, but not when we have an alert box or a date picker on top of the form. This is the real issue. The application crashes when we press the contrast adjustment button while there is an alert box open on top of my screen. Does anyone have any ideas? Thanks Prashant --- Ralf Dietrich <[EMAIL PROTECTED]> wrote: > Simply filter these event in your main application > loop and don't pass > it to SysHandleEvent(): > > e.g. AppEventLoop(): > > EvtGetEvent(&event, evtWaitForever); > // filter out special keys.. > if ((event.eType==keyDownEvent) && > ((event.data.keyDown.chr==vchrContrast) || > (event.data.keyDown.chr==vchrBrightness)) > else if (!SysHandleEvent(&event)) > { > // ... > } > > > Prashant Jha wrote: > > Hi, > > I'm using the following code in my EventLoop to > handle > > the keydown event from the contrast button on Palm > V > > and Palm IIIx and some symbol devices: > > > > if(( event.eType == keyDownEvent ) and > > (EvtKeydownIsVirtual(&event))) > > { > > //Ignore this event > > } > > It works fine on regular forms, ie when I am on a > > regular form and I press the contrast adjustment > > button, nothing happens and the event is ignored ( > the > > reason I'm ignoring it is because the contrast > > adjustment dialog will not come up). But if I have > a > > calendar widget open or an alert open on top of my > > form, pressing the contrast button crashes the > > application. > > Please help me with this problem as it is very > urgent > > for me to solve this problem. > > Hoping to hear from someone. > > Thanks > > Prashant > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! Platinum - Watch CBS' NCAA March Madness, > live on your desktop! > > http://platinum.yahoo.com > > > > > > > -- > For information on using the Palm Developer Forums, > or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/