diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index c2726347..dc6e5f16 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -289,6 +289,24 @@ high_resolution_scrolling high_resolution_scrolling = enabled +native_pen_touch +^^^^^^^^^^^^^^^^ + +**Description** + When enabled, Sunshine will pass through native pen/touch events from Moonlight clients. + + This can be useful to disable for older applications without native pen/touch support. + + .. Caution:: Applies to Windows only. + +**Default** + ``enabled`` + +**Example** + .. code-block:: text + + native_pen_touch = enabled + keybindings ^^^^^^^^^^^ diff --git a/src/config.cpp b/src/config.cpp index c0c4d59f..cde646a7 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -428,6 +428,7 @@ namespace config { true, // controller enabled true, // always send scancodes true, // high resolution scrolling + true, // native pen/touch support }; sunshine_t sunshine { @@ -1061,6 +1062,8 @@ namespace config { bool_f(vars, "always_send_scancodes", input.always_send_scancodes); bool_f(vars, "high_resolution_scrolling", input.high_resolution_scrolling); + bool_f(vars, "native_pen_touch", input.native_pen_touch); + int port = sunshine.port; int_between_f(vars, "port"s, port, { 1024 + nvhttp::PORT_HTTPS, 65535 - rtsp_stream::RTSP_SETUP_PORT }); sunshine.port = (std::uint16_t) port; diff --git a/src/config.h b/src/config.h index ce1cc418..44b89974 100644 --- a/src/config.h +++ b/src/config.h @@ -123,6 +123,7 @@ namespace config { bool always_send_scancodes; bool high_resolution_scrolling; + bool native_pen_touch; }; namespace flag { diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index 5559719b..b978748b 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -1720,7 +1720,9 @@ namespace platf { // We support pen and touch input on Win10 1809+ if (GetProcAddress(GetModuleHandleA("user32.dll"), "CreateSyntheticPointerDevice") != nullptr) { - caps |= platform_caps::pen_touch; + if (config::input.native_pen_touch) { + caps |= platform_caps::pen_touch; + } } else { BOOST_LOG(warning) << "Touch input requires Windows 10 1809 or later"sv; diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index 49a51dcf..71fc09d9 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -404,6 +404,18 @@ This can be useful to disable for older applications that scroll too fast with high resolution scroll events. + +