inputing “up” & “down” keys from the keyboard in monkeyrunne

Tag: monkeyrunner Author: beyond0235 Date: 2012-11-25

I am currently testing an application on Android platform using Monkeyrunner & python script. I want to know if there is any way to input the up & down keys from the keyboard using the device.press command.

I looked at the entire list of key events given in

http://developer.android.com/reference/android/view/KeyEvent.html

but couldnt find an option to press the up-down keys. Any suggestions ??

Other Answer1

You could use KEYCODE_DPAD_UP and KEYCODE_DPAD_DOWN. It's the same as pressing the up and down arrow keys on the keyboard. I used them in some of my tests.