如何在Symbian C ++中处理绿键(调用按钮)事件

时间:2013-10-04 11:10:36

标签: c++ symbian

我想用Symbian处理Green Key事件。我在KAknUidValueEndKeyCloseEvent的帮助下处理了Red Key(结束按钮)。你能告诉我Green Key事件的名称吗?这是必要的代码。

void CMobileDialerAppUi::HandleWsEventL(const TWsEvent &aEvent, CCoeControl *aDestination)
{
switch (aEvent.Type()) 

{
    case KAknUidValueEndKeyCloseEvent:
          {

                       TUid KMyAppUid = { 0x20070DF6 };
                       TApaTaskList tasklist(CCoeEnv::Static()->WsSession());
                       TApaTask task = tasklist.FindApp(KMyAppUid);
                       if(task.Exists())
                       {
                             task.BringToForeground();
                       }
                       symbian_ua_endcall();
          break;
          }

    default:

        CAknAppUi::HandleWsEventL(aEvent, aDestination);
    break;
    }
}

1 个答案:

答案 0 :(得分:0)

在您的容器覆盖方法OfferKeyEventL

TKeyResponse CMobileDialerContainer::OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType)
{
 if (EStdKeyDevice0==aKeyEvent.iScanCode){
if (aType == EEventKeyUp) {
                    //a green key has press
                return EKeyWasConsumed;
  }
 }
 return EKeyWasConsumed;
}