mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-21 03:52:48 +00:00
Fix right clicking inconsistency on different devices
This commit is contained in:
parent
69ecf0251d
commit
9b58e7bb4d
@ -517,7 +517,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
// ACTION_MOVE is special because it always has actionIndex == 0
|
// ACTION_MOVE is special because it always has actionIndex == 0
|
||||||
// We'll call the move handlers for all indexes manually
|
// We'll call the move handlers for all indexes manually
|
||||||
for (TouchContext aTouchContextMap : touchContextMap) {
|
for (TouchContext aTouchContextMap : touchContextMap) {
|
||||||
aTouchContextMap.touchMoveEvent(eventX, eventY);
|
if (aTouchContextMap.getActionIndex() < event.getPointerCount())
|
||||||
|
{
|
||||||
|
aTouchContextMap.touchMoveEvent(
|
||||||
|
(int)event.getX(aTouchContextMap.getActionIndex()),
|
||||||
|
(int)event.getY(aTouchContextMap.getActionIndex()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -22,6 +22,11 @@ public class TouchContext {
|
|||||||
this.actionIndex = actionIndex;
|
this.actionIndex = actionIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getActionIndex()
|
||||||
|
{
|
||||||
|
return actionIndex;
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isTap()
|
private boolean isTap()
|
||||||
{
|
{
|
||||||
int xDelta = Math.abs(lastTouchX - originalTouchX);
|
int xDelta = Math.abs(lastTouchX - originalTouchX);
|
||||||
@ -84,10 +89,8 @@ public class TouchContext {
|
|||||||
|
|
||||||
lastTouchX = eventX;
|
lastTouchX = eventX;
|
||||||
lastTouchY = eventY;
|
lastTouchY = eventY;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user