diff --git a/input/input.c b/input/input.c index 92e2a6d5b9..9890a0252b 100644 --- a/input/input.c +++ b/input/input.c @@ -735,6 +735,11 @@ static void feed_key(struct input_ctx *ictx, int code, double scale, release_down_cmd(ictx, false); return; } + if (code == MP_TOUCH_RELEASE_ALL) { + MP_TRACE(ictx, "release all touch\n"); + ictx->num_touch_points = 0; + return; + } if (!opts->enable_mouse_movements && MP_KEY_IS_MOUSE(unmod) && !force_mouse) return; if (unmod == MP_KEY_MOUSE_LEAVE || unmod == MP_KEY_MOUSE_ENTER) { diff --git a/input/keycodes.h b/input/keycodes.h index 1a21a3c89f..2e63df344f 100644 --- a/input/keycodes.h +++ b/input/keycodes.h @@ -216,6 +216,8 @@ #define MP_KEY_ANY_UNICODE (MP_KEY_INTERN+5) // For mp_input_put_key(): release all keys that are down. #define MP_INPUT_RELEASE_ALL (MP_KEY_INTERN+6) +// For mp_input_put_key(): release all touch points. +#define MP_TOUCH_RELEASE_ALL (MP_KEY_INTERN+7) // Emit a command even on key-up (normally key-up is ignored). This means by // default they binding will be triggered on key-up instead of key-down.