1 # Capture and display input events and coordinates
6 # do a throw-away adb in case the server is out-of-date
7 adb devices -l 2>&1 >/dev/null
12 (-d) DEVICE=$2; shift;;
14 echo Unknown option $1
20 if [ "$DEVICE" = "" ]; then
21 devInfo=$(adb devices -l | grep -v ^List | head -1)
24 DEVICE=$(echo $4 | sed 's/product://')
31 if [ $max -eq 0 ]; then
41 (shamu|hammerhead|bullhead|ariel)
42 # no scaling necessary
51 echo "Error: No display information available for $DEVICE"
55 echo Capturing input for $DEVICE...
56 stdbuf -o0 adb shell getevent -t |
57 stdbuf -o0 grep "event.: 0003" |
58 stdbuf -o0 grep "0003 003[0156a9]" |
59 stdbuf -o0 tr ':[]
\r' ' ' | while read line
65 (0035) x=$(convert $value $xmax $xscale);;
66 (0036) y=$(convert $value $ymax $yscale);;
67 (0030) tag="majorTouch";;
68 (0031) tag="minorTouch";;
69 (003a) tag="pressure";;
70 (0039) tag="trackingId";;
71 (--) echo unknown code=$code;;
73 printf "%-10s %-4d %-4d\n" $tag $x $y