1

How do i generate a double tap event on Android.

This is the implementation that i have done.

$event="/dev/event/event1"
$x=$1
$y=$2
sendevent $event 3 57 2421
sendevent $event 3 58 232
sendevent $event 3 53 $x
sendevent $event 3 54 $y
sendevent $event 0 0 0
sendevent $event 3 57 4294967295
sendevent $event 0 0 0
sendevent $event 3 57 2421
sendevent $event 3 58 232
sendevent $event 3 53 $x
sendevent $event 3 54 $y
sendevent $event 0 0 0
sendevent $event 3 57 4294967295
sendevent $event 0 0 0

With this implementation the double tap is slow that it appears as two separate single taps to the android system.

P.S: I tried these on Samsung Galaxy Nexus phone.

Naresh Kumar
  • 277
  • 4
  • 18

1 Answers1

0

Why do you need to implement your custom double tab event? Maybe you can use SimpleOnGestureListener, this listener has method onDoubleTap(MotionEvent e)

Yoric
  • 499
  • 3
  • 7
  • [SimpleOnGestureListener](http://developer.android.com/reference/android/view/GestureDetector.SimpleOnGestureListener.html) listens to the double tap gesture. All i want to do is to generate one. Not catch the gesture. There is a way to simulate a tap event `adb shell input tap ` but i want to figure out how to simulate doubletap. – Naresh Kumar Jul 02 '14 at 11:07