Thanks yucca. I figured it out. The problem is I am activating before setting up the messagelist. Now I reorganized the code and its working. But I am unable to use down and up arrows to select an item in the list. What do i have to do in order to select an item from the list and catch the event?
for keyevents (up, down, ok etc. ) you should use offer keyevent, just use it like this:
TKeyResponse CCompoundControl::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
TKeyResponse Ret = EKeyWasNotConsumed;
//Call your function that handles joy-stick middle click here
Ret = iListBox->OfferKeyEventL(aKeyEvent, aType);
if you want to catch the listbox event you'll just implement the
MEikListBoxObserver (i.e. derive the MEikListBoxObserver in your class and implement the function), then you also need to set the listbox to use your container class as a observer, see SDK docs for more info.