可以Android操作系统捕获蓝牙鼠标右键单击,滚轮事件? [英] can android os capture Bluetooth Mouse right-click and wheel event?

查看:1186
本文介绍了可以Android操作系统捕获蓝牙鼠标右键单击,滚轮事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个的Andr​​iod 2.3.5的手机,它可以连接到蓝牙鼠标。 但我觉得它只是回应左键单击和鼠标移动。

I have an andriod 2.3.5 phone,it can connect to a bluetooth mouse. But I find it only response to left-click and mouse-move.

if (event.getAction() == MotionEvent.ACTION_DOWN) {//Left Button

} else if (event.getAction() == MotionEvent.ACTION_UP) {//Left Button
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {

}

什么是其他行动codeS,比如右键,滚轮?

What are the other action codes,such as Right Button,Wheel?

感谢

推荐答案

您使用的是(10)显然API水平还没有任何挑剔的一个鼠标按钮或其他所有的点击都被视为触摸的方式屏幕上。如果你有14+的工作,你可以做 MotionEvent.getButtonState()来请检查是否这是小学,中学或其他按钮了pressed。

Apparently API level you're using (10) still doesn't have any way of discerning between one mouse button or the other and all clicks are treated as touches on the screen. If you were working with 14+ you could do MotionEvent.getButtonState() to check wether it's the primary, secondary or other button that got pressed.

来源

这篇关于可以Android操作系统捕获蓝牙鼠标右键单击,滚轮事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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