Hello,
If you guys notice if you have an application that displays a splash screen or that uses a custom UI like games for example, when you press the menu key the app menu is displayed and this is not estetical for a game app that already have a custom menu. So how can I desactivate the Menu key? I've tried to capture the menu key using the following function:
--------------------------------
TInt CMyAppUi::CaptureKeysL(TBool aCancelCapture)
{
TInt result = KErrNone;
if(iCaptureKeyIds!=NULL)
{
for(TInt i=0; i<iCaptureKeyIds->Count(); i++)
iCoeEnv->RootWin().CancelCaptureKeyUpAndDowns((*iCaptureKeyIds)[i]);
delete iCaptureKeyIds;
iCaptureKeyIds = NULL;
}
if(!aCancelCapture)
{
iCaptureKeyIds = new (ELeave) CArrayFixFlat<TInt32>(5);
// key Menu
result = iCoeEnv->RootWin().CaptureKeyUpAndDowns(EStdKeyMenu,0,0);
if(result>0)
iCaptureKeyIds->AppendL(result);
}
result = KErrNone;
return result;
}
--------------------------------
I think the Menu key generate an event at EEventKeyDown not at EEventKey. I've tried with CaptureKey and CancelCaptureKey also but not results.
I use this function like this:
// to start capture menu key
CaptureKeysL(EFalse);
.......
// to stop capture menu key
CaptureKeysL(ETrue);
and in my AppUi class I have:
----------------------------------------------------------------
TKeyResponse CMyAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
{
switch(aType)
{
case EEventKey:
case EEventKeyUp:
case EEventKeyDown:
{
switch(aKeyEvent.iScanCode)
{
case EStdKeyMenu:
return EKeyWasConsumed;
break;
}
}
break;
}
}
----------------------------------------------------
So why the menu key isn't captured?!?!?!?!
Maybe is another solution?
Anyway I use a splash screen in my app and when I press the menu key the menu bar is displayed over the splash and this is not very estetically. So If you solve this problem please give me a hint.
Thanks.






