I have a view with an onTouch
that can distinguish between touch input and left/middle/right mouse clicks, as in
@Override
public boolean onTouc
The accepted answer was a document link that led me to the example code in the question, but that answer was deleted. So that this question no longer appears 'unanswered', this is how your view can respond to a mousewheel:
@Override
public boolean onGenericMotionEvent(MotionEvent event) {
if (0 != (event.getSource() & InputDevice.SOURCE_CLASS_POINTER)) {
switch (event.getAction()) {
case MotionEvent.ACTION_SCROLL:
if (event.getAxisValue(MotionEvent.AXIS_VSCROLL) < 0.0f)
selectNext();
else
selectPrev();
return true;
}
}
return super.onGenericMotionEvent(event);
}
The mouse wheel event action is considered a scroll event