Make sure you are not inadvertently handling the event that is currently
being processed causing it to be ignored by the event loop.  I did something
similar where i simply changed the contents of the incoming event pointer
(it comes in as a nilEvent) in a form handle method.  This allowed me to
avoid having to addeventtoqueue.  The only thing I had to be sure to do was
indicate that the event was not handled so it would be processed by the
application event loop.

By the way, does anyone know of a reason I should not create an event in
this matter.  It seems to work but it seems a little kludgy.  Thanks.


"Venkata Tumati" <[EMAIL PROTECTED]> wrote in message
news:67643@palm-dev-forum...
>
> In my program, I will be waiting for data on the serial manager, When I
> receive the proper data,I want to simulate a KeyDownEvent, mainly for
> Raising the Antennae. For some reason, keydown event does not work when I
> call it from ReceiveData() function. It only works in the EventLoop. Can
> some body suggest on how to make the KeyDownEvent Work. Do I need to put
the
> KeyDownEvent in a special loop to make it work.
>
> Can I call the KeyDownEvent from Receive function only when it receives
the
> proper data from the serial port.
>
>
> Here is the code for teh KeyDownEvent
> void actioN1_cf_(void)
> {
> EventType theEvent;
>       theEvent.eType = keyDownEvent;
>       theEvent.data.keyDown.chr = vchrHardAntenna;
>       theEvent.data.keyDown.keyCode = 0;
>       theEvent.data.keyDown.modifiers = commandKeyMask;
>
> EvtAddEventToQueue(&theEvent);
> }
>
> EVENT LOOP///////////////
> void EventLoop ()
> {
> EventType event;
> Err error;
> actionN1_cf_()
> do{
> EvtGetEvent (&event, evtWaitForever);
>
> if (!SysHandleEvent (&event))
> if (!MenuHandleEvent (0, &event, &error))
> if (!ApplicationHandleEvent (&event))
> FrmDispatchEvent (&event);
> } while (event.eType != appStopEvent);
> }
>
> Thank you,
> Venkata
>
>
>



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