以编程方式在Android屏幕上移动鼠标指针 [英] Moving mouse pointer on Android screen programmatically
问题描述
我正在开发一个Android应用程序,我想在其中将鼠标"指针/光标移动到Android平板电脑上.我知道这是可能的,因为当我将鼠标(USB或BT)连接到Android平板电脑(Honeycomb +)时,会出现一个光标,并且我只能使用鼠标与平板电脑进行交互.我想通过Tablet上的Java控制该鼠标.
我已经有第二台设备可以与平板电脑进行通讯,并且可以将指针坐标流传输到平板电脑.
不,我不能使用蓝牙.我正在使用的第二台设备具有WiFi,但是无法驱动蓝牙.
我的想法是必须有一种移动鼠标指针的方法.
I am developing an Android application where I would like to move the "mouse" pointer/cursor on an Android tablet. I know this is possible because when I connect a mouse (USB or BT) to an Android tablet (Honeycomb+), a cursor appears and I can interact with the tablet using the mouse only. I would like to control that mouse from Java on the Tablet.
I already have a second device that can communicate the tablet and which can stream pointer coordinates to it.
And no I can't use bluetooth. The second device that I'm using has WiFi but no ability to drive BlueTooth.
My thought is that there must be a way to move the mouse pointer.
推荐答案
可以通过以下是Play商店中的示例应用: EVA面部鼠标应用程序
Here is an example app in the play store: EVA Facial Mouse app
这是一个通过WiFi(API级别21)控制鼠标指针的github存储库: chetbox /android-mouse-cursor
Here is a github repository for controlling the mouse pointer via WiFi (API level 21): chetbox/android-mouse-cursor
我已将后者的仓库分叉并将其更新为API级别27: Ra-Na/android-mouse-cursor
I have forked and updated the latter repo to API level 27: Ra-Na/android-mouse-cursor
这篇关于以编程方式在Android屏幕上移动鼠标指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!