diff --git a/srcs/juloo.keyboard2/Keyboard2View.java b/srcs/juloo.keyboard2/Keyboard2View.java index 41d32ef..ce6c9f4 100644 --- a/srcs/juloo.keyboard2/Keyboard2View.java +++ b/srcs/juloo.keyboard2/Keyboard2View.java @@ -172,7 +172,7 @@ public class Keyboard2View extends View _pointers.onTouchMove(event.getX(p), event.getY(p), event.getPointerId(p)); break; case MotionEvent.ACTION_CANCEL: - _pointers.onTouchCancel(event.getPointerId(event.getActionIndex())); + _pointers.onTouchCancel(); break; default: return (false); diff --git a/srcs/juloo.keyboard2/Pointers.java b/srcs/juloo.keyboard2/Pointers.java index e8dbc87..46b76fc 100644 --- a/srcs/juloo.keyboard2/Pointers.java +++ b/srcs/juloo.keyboard2/Pointers.java @@ -48,6 +48,8 @@ public final class Pointers implements Handler.Callback public void clear() { + for (Pointer p : _ptrs) + stopKeyRepeat(p); _ptrs.clear(); } @@ -128,13 +130,9 @@ public final class Pointers implements Handler.Callback } } - public void onTouchCancel(int pointerId) + public void onTouchCancel() { - Pointer ptr = getPtr(pointerId); - if (ptr == null) - return; - stopKeyRepeat(ptr); - removePtr(ptr); + clear(); _handler.onPointerFlagsChanged(true); }