@ -98,7 +98,7 @@ public class Controller {
break ;
break ;
case ControlMessage . TYPE_INJECT_SCROLL_EVENT :
case ControlMessage . TYPE_INJECT_SCROLL_EVENT :
if ( device . supportsInputEvents ( ) ) {
if ( device . supportsInputEvents ( ) ) {
injectScroll ( msg . getPosition ( ) , msg . getHScroll ( ) , msg . getVScroll ( ) );
injectScroll ( msg . getPosition ( ) , msg . getHScroll ( ) , msg . getVScroll ( ) , msg . getButtons ( ) );
}
}
break ;
break ;
case ControlMessage . TYPE_BACK_OR_SCREEN_ON :
case ControlMessage . TYPE_BACK_OR_SCREEN_ON :
@ -221,7 +221,7 @@ public class Controller {
return device . injectEvent ( event , Device . INJECT_MODE_ASYNC ) ;
return device . injectEvent ( event , Device . INJECT_MODE_ASYNC ) ;
}
}
private boolean injectScroll ( Position position , int hScroll , int vScroll ) {
private boolean injectScroll ( Position position , int hScroll , int vScroll , int buttons ) {
long now = SystemClock . uptimeMillis ( ) ;
long now = SystemClock . uptimeMillis ( ) ;
Point point = device . getPhysicalPoint ( position ) ;
Point point = device . getPhysicalPoint ( position ) ;
if ( point = = null ) {
if ( point = = null ) {
@ -239,7 +239,7 @@ public class Controller {
coords . setAxisValue ( MotionEvent . AXIS_VSCROLL , vScroll ) ;
coords . setAxisValue ( MotionEvent . AXIS_VSCROLL , vScroll ) ;
MotionEvent event = MotionEvent
MotionEvent event = MotionEvent
. obtain ( lastTouchDown , now , MotionEvent . ACTION_SCROLL , 1 , pointerProperties , pointerCoords , 0 , 0 , 1f , 1f , DEFAULT_DEVICE_ID , 0 ,
. obtain ( lastTouchDown , now , MotionEvent . ACTION_SCROLL , 1 , pointerProperties , pointerCoords , 0 , buttons , 1f , 1f , DEFAULT_DEVICE_ID , 0 ,
InputDevice . SOURCE_MOUSE , 0 ) ;
InputDevice . SOURCE_MOUSE , 0 ) ;
return device . injectEvent ( event , Device . INJECT_MODE_ASYNC ) ;
return device . injectEvent ( event , Device . INJECT_MODE_ASYNC ) ;
}
}