Android: Tracking mouse pointer movement
问题 Assuming that I am using a generic mouse, is it possible to track the X and Y coordinates of the mouse pointer in android? 回答1: You need a OnGenericMotionListener : OnGenericMotion(...., MotionEvent me) { if (me.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE) { } api 14+ needed [confirmed] Found me a tablet with usb mouse and can confirm this works for mouse movement. You WILL get flooded with messages, so simple operations or sleeping should be considered. 回答2: The docs to ACTION_MOVE lead me