How to prepare touchscreen-based Android device for [emergency] calling using only hardware buttons? If my touchscreen Android phone gets smashed I expect that it can happen that only touchscreen is broken (as it seems to be the most fragile part) while the device itself able to function somehow; and I maybe need to call somewhere using only hardware buttons (without screen at all).

Are there any programs to place and/or answer [emergency] calls by entering some pattern of hardware buttons without using screen as input or output? This can also be helpful when you are using the device in frost, in gloves, etc. so using touchscreen becomes problematic.

Having wet/cold/cracked_screen phone and not being able to call for help just because of touchscreen is not working can be unpleasant. With hardware buttons you can type the "sos code" sometimes even if both your and your phone's HP is low...

My device is SE Xperia X10, but I expect the thing to work one way or another with all devices with at least 1 hardware button.
I started implementing my own solution for my device.

Here (source) is a program that (started as root) will allow you to start shell scripts using series of button presses. Currently having started this monitor ( andrhard 66 /h/andrhard &lt; /dev/input/event2&amp;) I can easily toggle the flashlight without unlocking the phone (using /sys/class/leds/lv5219lg:fled/brightness)

Now the problems is how to call/answer from shell scripts...