Implement horizontal scrolling with Sunshine

This commit is contained in:
Cameron Gutman
2023-02-20 19:56:01 -06:00
parent 91dd7b7049
commit f4df0714b5
7 changed files with 42 additions and 14 deletions

View File

@@ -1521,6 +1521,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
if (event.getActionMasked() == MotionEvent.ACTION_SCROLL) {
// Send the vertical scroll packet
conn.sendMouseHighResScroll((short)(event.getAxisValue(MotionEvent.AXIS_VSCROLL) * 120));
conn.sendMouseHighResHScroll((short)(event.getAxisValue(MotionEvent.AXIS_HSCROLL) * 120));
}
if ((changedButtons & MotionEvent.BUTTON_PRIMARY) != 0) {
@@ -2187,10 +2188,15 @@ public class Game extends Activity implements SurfaceHolder.Callback,
}
@Override
public void mouseScroll(byte amount) {
public void mouseVScroll(byte amount) {
conn.sendMouseScroll(amount);
}
@Override
public void mouseHScroll(byte amount) {
conn.sendMouseHScroll(amount);
}
@Override
public void keyboardEvent(boolean buttonDown, short keyCode) {
short keyMap = keyboardTranslator.translate(keyCode, -1);