views:

573

answers:

3

Hey,

How would one go about capturing users keystrokes in the SMS composer on the Symbian OS, specifically for a Nokia N73 (or any of the symbian supported devices http://en.wikipedia.org/wiki/Symbian_OS#Devices_that_have_used_the_Symbian_OS)? I'm new to symbian development and I'm trying to write an application to analyse writing styles of those who send SMSs. Any information (or push in the right direction) would be great.

Many Thanks,

A

A: 

Well, there are several levels to answering to your question.

  • The keystrokes are actually captured by the message editor application. So, either it provides an API to feed you all its keystrokes (you can look for one on http://forum.nokia.com. You'll find the message editor API but it will be mostly about re-using GUI controls and not what you're looking for) or you would need a transparent application of your own that stays in the foreground and captures keystrokes before feeding them back to whatever application happens to be right behind. Fortunately (for obvious security reasons), Symbian OS will not allow you to do the later.

  • You can, however, have your own application read messages when they are saved in the phone memory: when they are saved in the Draft folder or in the SMS Outbox.

The obligatory shameless plug: I would advise reading the messaging chapter of http://www.quickrecipesonsymbianos.com in order to understand how to use the Symbian Message Store

The classes of interest in your case are : CmsvEntry, CMsvSession, MMsvSessionObserver, CMsvOperation and CSmsClientMtm.

QuickRecipesOnSymbianOS
+1  A: 

Actually, you can capture keystrokes destined for any application in Symbian OS. RWindowGroup::CaptureKey() and RWindowGroup::CaptureLongKey() allow your executable to capture keys from any applicaton, whether yours is in the foreground or not. However, in this case this may prove to be tedious - these two functions work by capturing specific key codes and modifier combinations, so you would have to set up a lot of captures to deal with all the key combinations in the SMS composer.

You would also have to pass the event on to the SMS composer once your exectuable had captured it. Whilst nominally possible using RWsSession::SendEventToWindowGroup() or TApaTask::SendKey(), there are complexities involved the events arrive in right order (i.e. key down, key event, key up) and behaviour of different FEPs (Front End Processors) for user input.

So whilst it is nominally feasible to do what you require as above, it would prove to be tedious to implement and test, bordering on the risky. If all you want to do is analyse writing style to collect data (rather than in a product app), you might be better off writing your own SMS composer - there are plenty of examples on the Forum Nokia web site of editors and SMS sending.

KevinD
A: 

On a related note - is there an API that can detect all the keys being pressed at once as I stamp on my Symbian phone in frustration at its APIs? ;-)

Alnitak