Android: generate two key presses at the same time using instrumentation api.
<p>I am making an android application where I want to trigger key strokes programmatically. I have tried using INSTRUMENTATION API in android but I don't know how to trigger two key strokes at the same time.<br>
I want to take a screen shot, which can be taken by pressing the home button and power button together.  </p>

<p>Please help<br>
posting sample code</p>

<pre><code> Instrumentation inst = new Instrumentation();
        inst.sendKeyDownUpSync( KeyEvent.KEYCODE_DPAD_UP );
        inst.sendKeyDownUpSync( KeyEvent.KEYCODE_DPAD_UP );
        inst.sendKeyDownUpSync( KeyEvent.KEYCODE_T );
        inst.sendKeyDownUpSync( KeyEvent.KEYCODE_E );
        inst.sendKeyDownUpSync( KeyEvent.KEYCODE_S );
        inst.sendKeyDownUpSync( KeyEvent.KEYCODE_T );
        inst.sendKeyDownUpSync( KeyEvent.KEYCODE_2 );
</code></pre>
