Standard symbian framwork will gives the keyevents to the application that is in foreground. So if if application is in foreground then it will receive keyevents by implementing OfferKeyEventL() method of CCoeControl in a class.
Listening keypress events when application is in background is bit difficault, but authour of this article explained it here in nice way. The class CKeyCapturer (in this article) will receive key events when application is in background.
--kamlesh sangani 14:56, 4 September 2009 (UTC)