How do I know that has been pressed on the headset and simulate pressing buttons on phone keypad
You can't with Python. It might be possible with Symbian C++, so you should do some searching and perhaps ask on that forum.
PyS60 Community Blog
New to PyS60? Read the FAQ!