How did you simulate finger sliding with a mouse? #598
Unanswered
meetAndEgg
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Are you using the Scrcpy client? It has a tiny Java application running on the device, and injects touch events using Android's hidden system API. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my project, when I simulated finger sliding with a mouse, my idea was to listen for
mousemove
event, and then send theswipe
command to my phone through adb. However, due to the frequent triggering ofmousemove
event, the commands sent are all short distance moving swipe commands. I tried usingthrottle
to reduce the frequency of event triggering, but the effect was still not good. If I wait for the mouse to finish moving before sending the command, the delay will be high. So I used your API to implement it, and I found that your API works very well. How did you implement it?我在我的项目中实现用鼠标滑动模拟手指滑动时,我的思路是监听鼠标按下且移动的事件,然后通过adb向手机发送swipe命令。但是由于滑动事件触发非常频繁,发送的都是短距离移动的swipe命令。我尝试使用节流以减少事件触发频率,效果还是不好。如果我等鼠标滑动结束后再发送命令,那么延迟就会很高。于是我使用了你的api来实现,我发现你的api效果很好,请问你是怎么实现的呢?
Beta Was this translation helpful? Give feedback.
All reactions