From 807a6d875a31a2d7c1d7956928a0f87c6c2e16c1 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Sat, 27 Apr 2024 03:02:27 -0400 Subject: [PATCH] options: add --native-touch option For platforms which send emulated mouse inputs for touch-unaware clients, such as Win32 and X11, this option enables the native multitouch handling and disables emulated mouse inputs. This enables interested scripts to handle multitouch events while keeping compatibility with touch-unaware scripts. --- DOCS/interface-changes/native-touch.txt | 1 + DOCS/man/options.rst | 11 +++++++++++ options/options.c | 1 + options/options.h | 1 + 4 files changed, 14 insertions(+) create mode 100644 DOCS/interface-changes/native-touch.txt diff --git a/DOCS/interface-changes/native-touch.txt b/DOCS/interface-changes/native-touch.txt new file mode 100644 index 0000000000..91c3a53bad --- /dev/null +++ b/DOCS/interface-changes/native-touch.txt @@ -0,0 +1 @@ +add --native-touch option diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index bad1e75354..b611e00ba2 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -4101,6 +4101,17 @@ Input Whether this applies depends on the VO backend and how it handles keyboard input. Does not apply to terminal input. +``--native-touch=`` + (Windows only) + For platforms which send emulated mouse inputs for touch-unaware clients, + such as Windows, use system native touch events, instead of receiving them + as emulated mouse events (default: no). This is required for multi-touch + support for these platforms. + + Note that this option has no effect on other platforms: either native touch + is not supported by mpv, or the platform does not give an option to receive + emulated mouse inputs (so native touch is always enabled, e.g. Wayland). + ``--input-ar-delay`` Delay in milliseconds before we start to autorepeat a key (default: 200). Set it to 0 to disable. diff --git a/options/options.c b/options/options.c index 8233b1a17f..4415ed8145 100644 --- a/options/options.c +++ b/options/options.c @@ -169,6 +169,7 @@ static const m_option_t mp_vo_opt_list[] = { {"keepaspect-window", OPT_BOOL(keepaspect_window)}, {"hidpi-window-scale", OPT_BOOL(hidpi_window_scale)}, {"native-fs", OPT_BOOL(native_fs)}, + {"native-touch", OPT_BOOL(native_touch)}, {"show-in-taskbar", OPT_BOOL(show_in_taskbar)}, {"display-fps-override", OPT_DOUBLE(display_fps_override), M_RANGE(0, DBL_MAX)}, diff --git a/options/options.h b/options/options.h index 6f7b011975..6733fa3161 100644 --- a/options/options.h +++ b/options/options.h @@ -56,6 +56,7 @@ typedef struct mp_vo_opts { bool keepaspect_window; bool hidpi_window_scale; bool native_fs; + bool native_touch; bool show_in_taskbar; int64_t WinID;