Listening to key events from app in the background

Login to reply to this topic.
Fri, 2007-01-05 13:52
Joined: 2004-07-12
Forum posts: 123
Hello,

is it possible for an app running in the background using the following code to listen to key events while it is still in hte BG? if yes how to do it, if not how to achieve it?

Code:
TApaTaskList taskList(CCoeEnv::Static()->WsSession());
TApaTask task = taskList.FindByPos(0);
CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(CCoeEnv::Static()->WsSession(), task.WgId());
if (wgName->AppUid().iUid == 0xA000017F)
     task.SendToBackground();
CleanupStack::PopAndDestroy(wgName);

Fri, 2007-01-05 15:29
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2009
Re: Listening to key events from app in the background
You have a "CaptureKey" primitive which can do that. Don't remember which class has it however.

Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Fri, 2007-01-05 15:52
Joined: 2004-07-12
Forum posts: 123
Re: Listening to key events from app in the background
Thanx Eric,

i checked in teh documentation and found that this cunction belongs to RWindowGroup class. What is the way to get a handle to the WidnowGroup object of my client window session? I know how to get the RWindow and RWsSession but never tried getting RWindowGroup! I checked in the SDK but could not find anything. Any idea how?

cheers
Fri, 2007-01-05 16:00
Joined: 2004-07-12
Forum posts: 123
Re: Listening to key events from app in the background
i think i found it. though i think it has bad naming, as it does not reflect its exact purpose.

RWIndowGrou wg = iCoeEnv->RootWin();

i will try this and c what would happen.

cheers
Fri, 2007-01-05 16:36
Joined: 2004-07-12
Forum posts: 123
Re: Listening to key events from app in the background
Fri, 2007-01-05 17:08
Joined: 2004-07-12
Forum posts: 123
Re: Listening to key events from app in the background
another solution at http://forum.newlc.com/index.php/topic,16049.0.html
it did not wolr for me though!
  • Login to reply to this topic.