We can capture keypresses whilst our app is in background through the use of RWindowGroup::CaptureKey(). The problem I'm having is that I need to *observe* the keypresses rather than capture them, leaving them free to be consumed by whatever application is in the foreground.
Specifically, I'm trying to observe EKeyYes presses with the phone on the idle screen without preventing the log application from coming to the foreground or an incoming call from being answered, which is what happens through simple use of CaptureKey.
Strangely, observing EKeyNo via CaptureKey with the same priorities allows the rest of the framework/ui to receive End Key events, so that if we're in a call, pressing End Key disconnects even though we receive the event.
I've tried calling RWsSession::SendEventToAllWindowGroups() in my application's HandleWsEventL(), and while it does work in that calls are answered or the Log App is launched, it's not a very elegant solution as it results in the Log App being launched when EKeyYes is pressed when the phone isn't in the Idle screen, i.e. in the menu screen.
A more targeted approach would be to use RWsSession::SendEventToWindowGroup() with the appropriate Window Group ID, but I don't know what that would be; Getting the WgID of the Phone Idle application and sending the event to it didn't result in the launch of the Log App.
Does anyone have any advice?