如何获取鼠标悬停的 x 和 y 坐标。
我在 android 中有一个服务,它通过 eneter 消息传递框架连接到 .net 应用程序。我想从服务中获得鼠标的 x 和 y 位置。我希望鼠标位置不仅在点击上,而且在鼠标悬停上。
非常感谢
如何获取鼠标悬停的 x 和 y 坐标。
我在 android 中有一个服务,它通过 eneter 消息传递框架连接到 .net 应用程序。我想从服务中获得鼠标的 x 和 y 位置。我希望鼠标位置不仅在点击上,而且在鼠标悬停上。
非常感谢
Maybe not a best solution but atleast it works. Both solutions are based on Genymotion emulator.
Depends on how long you wait before you do step 3, android can appear in genymotion or virtual box window.
Run VirtualBox app, go to your virtual box "android emulator":
Settings -> Display -> Remote Display -> Check Enable Server
Connect to your virtualbox with:
$ rdesktop -a 16 localhost:3389
While you move cursor in rdesktop, you can see pointer in genymotion android emulator window. Now you can intercept hover events.
There is maybe a better solution - disable mouse integration for virtual machine, so, virtualbox can grab mouse cursor, like:
$ VBoxManage modifyvm "your-vm-name" --mouse ps2
but it doesn't work for me, maybe genymotion launcher overrides settings on every launch?
Links: http://developer.android.com/reference/android/view/View.OnHoverListener.html
p.s. hover events are available starting from api 14.
您还可以在 Live CD 模式下使用Android x86(或使用 Windows 以双启动方式安装它)。