I have a working C source code for implementing writing of alphanumeric characters from a 3x4 keypad, similar to a normal cell phone 3x4 keypad. However, when I want to store the characters that have been typed from the keypad as a string, the characters that are on the same key as the one that I want to type, but appear before it, are also stored. For example, when I type the word monster, the characters that are stored on the string buffer are: mmnomnpqrstdepqr.
So I can get my final string by using the indexes: 0, 3, 5, 9, 10, 12, 15.
I want to take care of this situation so that my system can automatically extract only the intended characters from the whole string buffer, after the user has typed from the keypad.
So I am asking for suggestions as to how I can do this, I don't need source code but only suggestions and/or links to where I can get some information.