Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User liujinlong1's Avatar
    Join Date
    Mar 2010
    Posts
    6
    各位大哥,我想将后台运行的UI程序通过响应按键事件转入前台运行。搜索了一下网上的例子,照着葫芦画瓢。

    在UI类中加入
    Code:
    void CMyWalletAppUi::ConstructL()
    	{
    	// Initialise app UI with standard value.
    	BaseConstructL(CAknAppUi::EAknEnableSkin);
    
    	iSmsShield = CSmsShield::NewL();
    	
    	// Create view object
    	iAppView = CMyWalletAppView::NewL(ClientRect());
    	iAppView->SetMopParent(this);
    	//iAppView->ConstructL( ClientRect() );
    	
    	iEikonEnv->RootWin().CaptureKey(EStdKeyRightShift,0,0 );
    	iEikonEnv->RootWin().CaptureKeyUpAndDowns(19,0, 0); 	 
                         AddToStackL( iAppView ); 
        }
    再添加一个方法:
    TKeyResponse CMyWalletAppUi::HandleKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType)
    {
    TBuf<64> text;
    _LIT(KErrorStr, "ScanCode: %d");
    text.Format(KErrorStr, aKeyEvent.iScanCode);
    (new (ELeave) CAknInformationNote)->ExecuteLD(text);
    }
    结果,在前台运行时,按abc键,弹出 ScanCode:50 ,通过aKeyEvent.iCode取值都是0
    转入后台就没有任何响应了。

    SOS
    Last edited by liujinlong1; 2010-11-12 at 03:01.

  2. #2
    Registered User liujinlong1's Avatar
    Join Date
    Mar 2010
    Posts
    6
    谁有简单的类似helloworld的程序也可,只要实现了通过菜单转入后台运行,通过特殊按键再转到前台运行。谢谢了。感谢的五体投地了。发到如下邮箱。
    liujinlong@kongzhong.com

  3. #3
    Super Contributor Cxt_programmer's Avatar
    Join Date
    Feb 2006
    Location
    Beijing
    Posts
    4,360
    Quote Originally Posted by liujinlong1 View Post
    结果,在前台运行时,按abc键,弹出 ScanCode:50 ,通过aKeyEvent.iCode取值都是0
    转入后台就没有任何响应了。
    SOS
    你已经看到:按abc键时,ScanCode:50,而你capture的时候传的参数并不是这个值。
    Stay Hungry. Stay Foolish.
    Sina Weibo:
    http://weibo.com/cxt728
    QQ Weibo:
    http://t.qq.com/Cxt_programmer

Similar Threads

  1. [moved] n73 themes problem
    By dr3florin in forum Themes/Carbide.ui
    Replies: 1
    Last Post: 2009-09-26, 19:11
  2. [moved] why i can not load DLL on Nokia N73
    By sean_bean in forum Symbian C++
    Replies: 3
    Last Post: 2009-03-06, 14:47
  3. [moved] any applicatios for Nokia N73 ME is available...?
    By jaisongk in forum General Development Questions
    Replies: 4
    Last Post: 2008-09-10, 12:53
  4. [moved] WAP2.0 browser for Nokia N73
    By liuxingyu_best in forum Mobile Web Site Development
    Replies: 7
    Last Post: 2008-09-03, 13:34
  5. [moved] Copyright on Songs for N73
    By Skarrata in forum General Development Questions
    Replies: 1
    Last Post: 2008-06-20, 15:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved