browserui/browser/BrowserAppSrc/BrowserGotoPane.cpp
changeset 15 e45c3f40ea5f
parent 10 57d5b8e231c4
child 18 4530440261a8
equal deleted inserted replaced
10:57d5b8e231c4 15:e45c3f40ea5f
   485              || aKeyEvent.iCode == EStdKeyDevice10 )            //   : Extra KeyEvent supports diagonal event simulator wedge
   485              || aKeyEvent.iCode == EStdKeyDevice10 )            //   : Extra KeyEvent supports diagonal event simulator wedge
   486             {                                                   // Any of those? If so, then...
   486             {                                                   // Any of those? If so, then...
   487             return EKeyWasConsumed;                             // Ignore diagonal navigation events here
   487             return EKeyWasConsumed;                             // Ignore diagonal navigation events here
   488             }
   488             }
   489 
   489 
   490         if ( (aKeyEvent.iCode == EKeyOK ) && iGPObserver && IsFocused() )
   490         // For touch UI, handle enter key from VKB as a "GOTO"
       
   491         if (AknLayoutUtils::PenEnabled() && aKeyEvent.iCode == EKeyEnter)
       
   492             {
       
   493             CBrowserAppUi::Static()->ActiveView()->HandleCommandL(EWmlCmdGotoPaneGoTo);
       
   494             return EKeyWasConsumed;
       
   495             }
       
   496         else if ( ((aKeyEvent.iCode == EKeyOK ) || (aKeyEvent.iCode == EKeyEnter))
       
   497              && iGPObserver 
       
   498              && IsFocused() )
   491             {
   499             {
   492             if ( CBrowserAppUi::Static()->ContentView()->MenuBar()->MenuPane()->IsVisible() )
   500             if ( CBrowserAppUi::Static()->ContentView()->MenuBar()->MenuPane()->IsVisible() )
   493                 {
   501                 {
   494                 return CBrowserAppUi::Static()->ContentView()->MenuBar()->MenuPane()->OfferKeyEventL( aKeyEvent, aType );
   502                 return CBrowserAppUi::Static()->ContentView()->MenuBar()->MenuPane()->OfferKeyEventL( aKeyEvent, aType );
   495                 }
   503                 }
   496             else
   504             else
   497                 {
   505                 {
       
   506                 // If there is an observer and we have the focus, enter key is
       
   507                 // consumed and observer is notified.
   498                 iGPObserver->HandleGotoPaneEventL
   508                 iGPObserver->HandleGotoPaneEventL
   499                                 ( this, MGotoPaneObserver::EEventEnterKeyPressed );
   509                                 ( this, MGotoPaneObserver::EEventEnterKeyPressed );
   500                 return EKeyWasConsumed;                         // If there is an observer and we have the focus,
   510                 return EKeyWasConsumed;
   501 		}                                               //   enter key is consumed and observer is notified.
   511                 }
   502             }
   512             }        
   503 
       
   504         else if (AknLayoutUtils::PenEnabled() && aKeyEvent.iCode == EKeyEnter)
       
   505             {                                                   // For touch UI, handle enter key from VKB as a "GOTO"
       
   506             CBrowserAppUi::Static()->ActiveView()->HandleCommandL(EWmlCmdGotoPaneGoTo);
       
   507             return EKeyWasConsumed;
       
   508             }
       
   509 
   513 
   510         if ( iSearchEditor && iSearchPaneActive )
   514         if ( iSearchEditor && iSearchPaneActive )
   511             {
   515             {
   512             resp = iSearchEditor->OfferKeyEventL( aKeyEvent, aType );
   516             resp = iSearchEditor->OfferKeyEventL( aKeyEvent, aType );
   513             }
   517             }