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.
This commit is contained in:
nanahi 2024-04-27 03:02:27 -04:00 committed by Kacper Michajłow
parent f0e163bab5
commit 807a6d875a
4 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1 @@
add --native-touch option

View File

@ -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=<yes|no>``
(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.

View File

@ -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)},

View File

@ -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;