Code:
TKeyResponse Ctest1Container2::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
{
if(aKeyEvent.iCode == EKeyOK)
{
if(iCba == R_AVKON_SOFTKEYS_OPTIONS_BACK)
{
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
cba->SetCommandSetL(R_AVKON_SOFTKEYS_CANCEL);
cba->MakeVisible(EFalse); //Add this line to the source code
cba->DrawNow();
cba->MakeVisible(ETrue); //Add this line to the source code
//CEikonEnv::Static()->InfoWinL(_L("info"), _L("hi"));
iCba = R_AVKON_SOFTKEYS_CANCEL;
}
else
{
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_BACK);
cba->MakeVisible(EFalse); //Add this line to the source code
cba->DrawNow();
cba->MakeVisible(ETrue); //Add this line to the source code
//CEikonEnv::Static()->InfoWinL(_L("info"), _L("hi"));
iCba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
}
return EKeyWasConsumed;
}
return EKeyWasNotConsumed;
}