Why unexpected OfferKeyEventL is called after HandleListBoxEventL is called on S60v5?
On S60v5, I used view-container-ListBox(subclass of CAknSingleGraphicStyleListBox)+CEikGlobalTextEditor. This listbox is a multiple selection one.
I called CAknSingleGraphicStyleListBox::SetListBoxObserver in Container::ConstructL. When user selects/unselects one item of listbox, system will call HandleListBoxEventL(EEventItemClicked), and call OfferKeyEventL(aKeyEvent.iCode==EKeyDevice3) which is not my expected.
Please help me to figure out why this unexpected OfferKeyEventL happened and how I change code.
Re: Why unexpected OfferKeyEventL is called after HandleListBoxEventL is called on S6
transfer the key to your list box in Container::OfferKeyEventL(), like
Container::OfferKeyEventL()
{
return listbox->OfferKeyEventL();
}
Re: Why unexpected OfferKeyEventL is called after HandleListBoxEventL is called on S6
But I have two controls, one is listbox, another is CEikGlobalTextEditor.
OfferKeyEventL():
if(aType == EEventKey)
switch (aKeyEvent.iCode)
{
case EKeyEnter:
case EKeyDevice3:
{
if(iEdwinQuery->IsFocused())
{
// Always go to here
}
else
{
return listbox->OfferKeyEventL();
}
...
But when I debug, listbox can not get focused. I do not know why.
Re: Why unexpected OfferKeyEventL is called after HandleListBoxEventL is called on S6
You need to manage the focus distribution between child controls by using CCoeControl::SetFocus()