×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    50

    Handling Key events in background running application !!

    Hello everyone..

    I am trying to handle key event in an application that is running in the background. I send the application in background using this code:
    Code:
    TApaTask task(iEikonEnv->WsSession());
    task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
    task.SendToBackground();
    I write this code in the AppUi constructor, so that the application starts in the background, not visible to the user. Next, in the in my AppContainer class I override the OfferKeyEventL function to perform some action (e.g. bringing the application back to foreground) on the Call button like this:

    Code:
    TKeyResponse CHelloWorldAppView::OfferKeyEventL(const TKeyEvent& aKeyEvent,enum TEventCode aType)
    {
    if (aType == EEventKey)
    	{
    	if (aKeyEvent.iScanCode == EStdKeyYes)
    		{
    		TApaTask task(iEikonEnv->WsSession());
    		task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
    		task.BringToForeground();
    		return EKeyWasConsumed;
    		}
    	}
    	return EKeyWasNotConsumed;
    }
    But the desired action is not taking place. How can I make the background application respond to normal user behavior, like i said to the call button.

    Thanks

    Sanjay Rajwani!

  2. #2
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: Handling Key events in background running application !!

    Hi

    In wikki a example code for handling key event, and search in discussion board here many threads for this.
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

Similar Threads

  1. Replies: 9
    Last Post: 2008-09-04, 07:22
  2. Replies: 0
    Last Post: 2007-09-11, 20:22
  3. Capturing Key Events when app is running in background
    By y10913 in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-11-08, 19:57
  4. Application running in background
    By one1_one1 in forum Mobile Java General
    Replies: 4
    Last Post: 2004-09-22, 01:09
  5. Running application in the background
    By artemg in forum Mobile Java General
    Replies: 0
    Last Post: 2004-01-05, 12:54

Posting Permissions

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