views:

574

answers:

1

Hey,

I'm trying to write a simple prototyping appliaction in python to capture a users keystrokes while writing a text messages (SMS) to collect some stat info for use in a biometric application for Symbian based phones. I have never used python before and have had very little exposure to it. However, I did come across an example http://wiki.forum.nokia.com/index.php/How_to_use_Keys_in_PyS60 detailing how to capture UP, DOWN, LEFT, RIGHT, and 0-9 easily enough. I tried to find information on key_codes and keypress in the pys60 API but little is available as I'm looking for an example of how to capture characters such as 'a', 'b' etc. assuming that predictive text is disabled. Also, if it is not possible to capture characters, how feasible is it to map keypresses to characters? i.e. 228 = 'b','t'?

Can anyone provide me with some examples, suggestions or a push in the right direction?

+1  A: 

I think you are searching for the wrong thing here.

Key codes and keypress events will only capture up, down, etc. (actual buttons), as you already stated. The user can enter letters in multiple ways, which is all done through software (e.g. 22 is a 'b', or 228 might be 'cat' or 'bat') and there is no way to tell what the user entered based just on the buttons they hit. There is also auto-completion built into most phones, which will add characters the user did not press buttons for.

Try searching for ways of capturing the actual text the user is seeing.

jcoon
This is assuming they are using predictive text. What about when its basic user input? ie. 22 = 'b', 228 = 'b','t'?
abnev
Or is 228 = 'a', 'a', 't'? Hmm..
vgm64
Well, it can be decoded based on the time between each keypress.
abnev