I am trying to create an application that will be activated by an in-coming
call event. after the incoming call is being answered or rejected I want my
application to move to the background.
I have the following problems:
1. When my application becomes the foreground application (on incoming
call), I can't answer the call but I can terminate it. how can I make my
application to NOT get the keyboard focus when it has the foreground
2. After moving my app to the background I want to move it again to the
foreground if the user clicks on its icon again. however since it was marked
as background application, the 'FocusChanged' is not being called in such
event. so how can I know when someone clicked on my app ? - or is there away
to make my application hiden but when the user clicks on its icon the os
will run the 'FocusChanged' method ?
Have you got the solution? I am facing the same problem with your first question. I bring my window to the foreground when there is incoming call, but the option key can't work because my application get the focus.
When your application loses or gains focus, i.e comes to the foreground or goes in the background, HandleForegroundEventL function in the AppUI gets called with TBool aForeground set to ETrue if it comes to the foreground and EFalse when it goes to the background.
I believe you would have code to Capture keys using something like :-
//Capture the NO Key
iCaptureKeyHandlers.Append(CEikonEnv::Static()->RootWin().CaptureKey(EStdKeyNo, 0, 0));
iCaptureUpAndDownHandlers.Append(iEikonEnv->RootWin().CaptureKeyUpAndDowns( EStdKeyNo, 0, 0 ));
in a function AddCaptureKeys or something..and then another function called CancelCaptureKeys when you dont want to capture the key events.
So now If you want to get the key events when your app is in the foreground u call the AddCaptureKeys and if u dont want to recieve key events when app in background, call the CancelCaptureKeys.
Also make sure that your application has the SwEvent capability added for this to work on Series60 3rd Edition devices.