Fix[controls]: handle secondary pointer being removed

This commit is contained in:
Mathias-Boulay 2023-05-05 10:32:26 +02:00
parent 1d958abdab
commit c963bc2b6c

View File

@ -303,7 +303,9 @@ public class ControlLayout extends FrameLayout {
ControlInterface lastControlButton = mapTable.get(v); ControlInterface lastControlButton = mapTable.get(v);
//Check if the action is cancelling, reset the lastControl button associated to the view //Check if the action is cancelling, reset the lastControl button associated to the view
if(ev.getActionMasked() == MotionEvent.ACTION_UP || ev.getActionMasked() == MotionEvent.ACTION_CANCEL){ if(ev.getActionMasked() == MotionEvent.ACTION_UP
|| ev.getActionMasked() == MotionEvent.ACTION_CANCEL
|| ev.getActionMasked() == MotionEvent.ACTION_POINTER_UP){
if(lastControlButton != null) lastControlButton.sendKeyPresses(false); if(lastControlButton != null) lastControlButton.sendKeyPresses(false);
mapTable.put(v, null); mapTable.put(v, null);
return; return;