×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jun 2004
    Posts
    135

    How to desactivate the Menu Key ?...

    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.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: How to desactivate the Menu Key ?...

    just define different set of buttons to be used when showing the splash screen, and only when it is dismissed, change back to options-exit buttons.

    yucca

  3. #3
    Regular Contributor
    Join Date
    Jun 2004
    Posts
    135

    Re: How to desactivate the Menu Key ?...

    Oh, sorry, I forgot to mention, I develop for Series80 platform and I must define an empty menu resource at least in order to be able to add dinamically or not other menu options(I've tried to load another resource after the splash is dismissed but it doesn't work).

  4. #4
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Bangalore
    Posts
    285

    Re: How to desactivate the Menu Key ?...

    Quote Originally Posted by GeKI View Post
    Oh, sorry, I forgot to mention, I develop for Series80 platform and I must define an empty menu resource at least in order to be able to add dinamically or not other menu options(I've tried to load another resource after the splash is dismissed but it doesn't work).
    Dude,
    Capture EKeyMenu in OfferEventL. Hopefully this should work.

    Regards
    Shashi Kiran G M

Similar Threads

  1. CBA, menu and key events
    By joker_pl in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-09-19, 10:27
  2. How to invalidate the menu key?
    By smartbrisk in forum Symbian
    Replies: 2
    Last Post: 2005-03-16, 06:02
  3. handling the menu key and end call key on gameplay
    By yonan32 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-08-26, 10:23
  4. Menu Key (EKeyApplication)
    By mikkyt in forum Symbian
    Replies: 1
    Last Post: 2003-04-24, 07:42
  5. menu from select key press.
    By engrsanjiv in forum Symbian
    Replies: 0
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×