mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 19:42:45 +00:00
Fix mouse scrolling and remove unreachable code
This commit is contained in:
parent
b6ee0764ff
commit
1f09cbd609
@ -552,15 +552,6 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
touchContextMap[i].touchMoveEvent(eventX, eventY);
|
touchContextMap[i].touchMoveEvent(eventX, eventY);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MotionEvent.ACTION_HOVER_MOVE:
|
|
||||||
// Send a mouse move update (if neccessary)
|
|
||||||
updateMousePosition((int)event.getX(), (int)event.getY());
|
|
||||||
break;
|
|
||||||
case MotionEvent.ACTION_SCROLL:
|
|
||||||
// Send the vertical scroll packet
|
|
||||||
byte vScrollClicks = (byte) event.getAxisValue(MotionEvent.AXIS_VSCROLL);
|
|
||||||
conn.sendMouseScroll(vScrollClicks);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -570,6 +561,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
{
|
{
|
||||||
int changedButtons = event.getButtonState() ^ lastButtonState;
|
int changedButtons = event.getButtonState() ^ lastButtonState;
|
||||||
|
|
||||||
|
if (event.getActionMasked() == MotionEvent.ACTION_SCROLL) {
|
||||||
|
// Send the vertical scroll packet
|
||||||
|
byte vScrollClicks = (byte) event.getAxisValue(MotionEvent.AXIS_VSCROLL);
|
||||||
|
conn.sendMouseScroll(vScrollClicks);
|
||||||
|
}
|
||||||
|
|
||||||
if ((changedButtons & MotionEvent.BUTTON_PRIMARY) != 0) {
|
if ((changedButtons & MotionEvent.BUTTON_PRIMARY) != 0) {
|
||||||
if ((event.getButtonState() & MotionEvent.BUTTON_PRIMARY) != 0) {
|
if ((event.getButtonState() & MotionEvent.BUTTON_PRIMARY) != 0) {
|
||||||
conn.sendMouseButtonDown(MouseButtonPacket.BUTTON_LEFT);
|
conn.sendMouseButtonDown(MouseButtonPacket.BUTTON_LEFT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user