I'm not into the internals of the API but I think this event will only sent 
when a object has the focus. At least it wouldn't be a good idea to handle a 
object focus event if the object hasn't the focus. Give this a try 

FrmSetFocus(frm, FrmGetObjectIndex(frm, ListTable));
FrmNavObjectTakeFocus(frm, ListTable);


Benjamin

        
> Hello,

> I am losing in such a problem.

> I want to add such an event, frmObjectFocusTakeEvent, to event > queue
> and handle it whenever a keydown event happened.
> So, I write my code like that,
> if ((eventP->eType == keyDownEvent ))
> {
> status_t err;
> EventType tEvent = {0};
> printf("adding event...\n");
> tEvent.eType = frmObjectFocusTakeEvent;
> // tEvent.data.ctlSelect.controlID = <default key>;
> err = EvtAddEventToQueue(&tEvent);
> printf("err is: %d", err);
> printf("end\n");
> handled = true;
> }
> 
> after testing, I found, the event should be added into the event > queue
> successfully, cause err is printed out to be 0. However, after > trace
> output, I found the program didn't handle the added event at all.
> it did generate KeyDownEvent, added frmObjectFocusTakeEvent into
> queue, but didn't generate frmObjectFocusTakeEvent after that. My
> printf for handle frmObjectFocusTakeEvent prints nothing.
> 
> I had ever use the same way to add a ctlSelectEvent, with a > > particula
> controlID, it works as expected. So, I don't know why it cann't > work
> with frmObjectFocusTakeEvent. (My machine is surly can generate
> frmObjectFocusTakeEvent which is after testing)
> 
> Very appreciate if anyone can give me some idea.
> Thanks
> Reply
-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to