Add support for scrolling with d-pad in mouse emulation mode

This commit is contained in:
Cameron Gutman 2018-02-24 18:57:09 -08:00
parent ae6f797436
commit 6557cba307

View File

@ -609,6 +609,16 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
conn.sendMouseButtonUp(MouseButtonPacket.BUTTON_RIGHT);
}
}
if ((changedMask & ControllerPacket.UP_FLAG) != 0) {
if ((inputMap & ControllerPacket.UP_FLAG) != 0) {
conn.sendMouseScroll((byte) 1);
}
}
if ((changedMask & ControllerPacket.DOWN_FLAG) != 0) {
if ((inputMap & ControllerPacket.DOWN_FLAG) != 0) {
conn.sendMouseScroll((byte) -1);
}
}
conn.sendControllerInput(controllerNumber, getActiveControllerMask(),
(short)0, (byte)0, (byte)0, (short)0, (short)0, (short)0, (short)0);