There are several types of input events, in which touch event and hover event are both included.
final int source = q.mEvent.getSource();
if ((source & InputDevice.SOURCE_CLASS_POINTER) != 0) {
deliverPointerEvent(q);
} else if ((source & InputDevice.SOURCE_CLASS_TRACKBALL) != 0) {
deliverTrackballEvent(q);
} else {
deliverGenericMotionEvent(q);
}
The code above is a portion of function deliveryInputEvent(...). The two types are processed separately.
The latest devices have touchless sensors that will detect digits or stylus that are close to the screen but not touching. These are to be used for preview functions like tooltips and small thumbnails.
This technology is dark magic and should not be toyed with lightly.
I expect that most of the time, smaller developers will only have the resources to process the touch events.