Nexus 1会忽略通过ADB发送的触摸事件 [英] Nexus one ignores touch events sent via ADB

查看:95
本文介绍了Nexus 1会忽略通过ADB发送的触摸事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过USB(使用ADB)将HTC Nexus One连接到我的PC,并运行Android 2.3.6,并且启用了调试模式。
发送单个密钥,这样!

I'm connecting an HTC Nexus One to my PC via USB (using ADB), running Android 2.3.6, with debug mode enabled. Sending individual keys as such, Works!

adb shell input keyevent 82
adb shell input keyevent 20
adb shell input keyevent 20
adb shell input keyevent 22
adb shell input keyevent 22
adb shell input keyevent 22
adb shell input keyevent 66

但是,发送触摸事件失败

However, Sending Touch events as such, Fails

adb shell sendevent /dev/input/event3 0003 48 104
adb shell sendevent /dev/input/event3 0003 50 10
adb shell sendevent /dev/input/event3 0003 53 200
adb shell sendevent /dev/input/event3 0003 54 57
adb shell sendevent /dev/input/event3 0000 2 00000000
adb shell sendevent /dev/input/event3 0003 18 47
adb shell sendevent /dev/input/event3 0003 20 00000001
adb shell sendevent /dev/input/event3 0000 0000 00000000
adb shell sendevent /dev/input/event3 0003 48 00000000
adb shell sendevent /dev/input/event3 0003 50 10
adb shell sendevent /dev/input/event3 0003 53 200
adb shell sendevent /dev/input/event3 0003 54 57
adb shell sendevent /dev/input/event3 0000 0002 00000000
adb shell sendevent /dev/input/event3 0003 18 32
adb shell sendevent /dev/input/event3 0003 20 00000000
adb shell sendevent /dev/input/event3 0000 0000 00000000

这是我从getevents获得的输出:

Here is the output I get from getevents:

add device 1: /dev/input/event6

  name:     "mahimahi-nav"

add device 2: /dev/input/event5

  name:     "mahimahi-keypad"

add device 3: /dev/input/event4

  name:     "proximity"

add device 4: /dev/input/event3

  name:     "synaptics-rmi-touchscreen"

add device 5: /dev/input/event2

  name:     "compass"

add device 6: /dev/input/event1

  name:     "h2w headset"

add device 7: /dev/input/event0

  name:     "lightsensor-level"

任何想法或想法如何通过ADB发送触摸事件?

Any thoughts or ideas how can I send touch events via ADB ?

推荐答案

我认为您需要设置X和Y轴接触点,然后尝试发送事件。另外,请确保您将其转换

I think you need to set your X and Y axis touch points and then try to send the events. Also, make sure that you convert this

adb shell sendevent /dev/input/event3 0003 48 104
adb shell sendevent /dev/input/event3 0003 50 10
adb shell sendevent /dev/input/event3 0003 53 200
adb shell sendevent /dev/input/event3 0003 54 57
adb shell sendevent /dev/input/event3 0000 2 00000000

转换成这样的十进制值(因为我只对第一行做了但是您将需要全部完成此操作),

into decimal values like this (as I did only for first line but you will need to do that for all),

adb shell sendevent /dev/input/event3 3 72 260.

有关更多信息,请参见此链接 http://softteco.blogspot.com/2011/03/android-low-level-shell-click- on-screen.html

For more information, look at this link http://softteco.blogspot.com/2011/03/android-low-level-shell-click-on-screen.html

这篇关于Nexus 1会忽略通过ADB发送的触摸事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆