Simulate Screen Touch?

428 views
Skip to first unread message

steve.p...@gmail.com

unread,
Feb 13, 2016, 11:57:43 PM2/13/16
to Automate
Can I simulate a screen touch? I'm not sure if the interact button is the right one, but I don't care about what the target is I just want simulate a touch that I can use on any app..

Is that possible?

Henrik "The Developer" Lindqvist

unread,
Feb 14, 2016, 8:38:33 AM2/14/16
to Automate, steve.p...@gmail.com
You can use the Shell command superuser block to execute the input command.

Usage: input [<source>] <command> [<arg>...]

The sources are:
      trackball
      joystick
      touchnavigation
      mouse
      keyboard
      gamepad
      touchpad
      dpad
      gesture
      stylus
      touchscreen

The commands and default sources are:
      text <string> (Default: touchscreen)
      keyevent [--longpress] <key code number or name> ... (Default: keyboard)
      tap <x> <y> (Default: touchscreen)
      swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
      press (Default: trackball)
      roll <dx> <dy> (Default: trackball)

unlos...@gmail.com

unread,
Jun 23, 2016, 3:31:17 AM6/23/16
to Automate
Can you provide an example of a functional code please? I can't seem to make it work..thanks!

mat.v...@gmail.com

unread,
Jul 29, 2017, 2:48:21 AM7/29/17
to Automate
Oh, this looks good, but I expect I need root, don't I?
Thanks

Henrik "The Developer" Lindqvist

unread,
Jul 31, 2017, 2:53:17 PM7/31/17
to Automate, mat.v...@gmail.com
Yes.
Reply all
Reply to author
Forward
0 new messages