diff --git a/src/config.cpp b/src/config.cpp index e68691bb..57f144f8 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -571,6 +571,7 @@ namespace config { true, // high resolution scrolling true, // native pen/touch support false, // enable input only mode + true, // enable_rumble_messages_to_controllers }; sunshine_t sunshine { @@ -1286,6 +1287,7 @@ namespace config { bool_f(vars, "envvar_compatibility_mode", sunshine.envvar_compatibility_mode); bool_f(vars, "notify_pre_releases", sunshine.notify_pre_releases); bool_f(vars, "legacy_ordering", sunshine.legacy_ordering); + bool_f(vars, "enable_rumble_messages_to_controllers", input.enable_rumble_messages_to_controllers); int port = sunshine.port; int_between_f(vars, "port"s, port, {1024 + nvhttp::PORT_HTTPS, 65535 - rtsp_stream::RTSP_SETUP_PORT}); diff --git a/src/config.h b/src/config.h index 49de6bc1..4fc3366b 100644 --- a/src/config.h +++ b/src/config.h @@ -211,6 +211,7 @@ namespace config { bool native_pen_touch; bool enable_input_only_mode; + bool enable_rumble_messages_to_controllers; }; namespace flag { diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index 50f8aab8..daf218d9 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -327,6 +327,11 @@ namespace platf { * @param smallMotor The small motor. */ void rumble(target_t::pointer target, std::uint8_t largeMotor, std::uint8_t smallMotor) { + // config::input.enable_rumble_messages_to_controllers - Default is true so ignore rumble messages when false + if( config::input.enable_rumble_messages_to_controllers == false ) { + // Do nothing; just return + return; + } for (int x = 0; x < gamepads.size(); ++x) { auto &gamepad = gamepads[x]; diff --git a/src/upnp.cpp b/src/upnp.cpp index 625a7a69..b7edd025 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -6,6 +6,7 @@ #include // workaround for type_t error in miniupnpc 2.3.3, see https://github.com/miniupnp/miniupnp/commit/e263ab6f56c382e10fed31347ec68095d691a0e8 // lib includes +#include // Needed to compile size_t in Windows #include #include diff --git a/src_assets/common/assets/web/config.html b/src_assets/common/assets/web/config.html index 41dfe376..263406ee 100644 --- a/src_assets/common/assets/web/config.html +++ b/src_assets/common/assets/web/config.html @@ -176,6 +176,7 @@ "high_resolution_scrolling": "enabled", "native_pen_touch": "enabled", "enable_input_only_mode": "disabled", + "enable_rumble_messages_to_controllers": "enabled", "keybindings": "[0x10,0xA0,0x11,0xA2,0x12,0xA4]", // todo: add this to UI }, }, diff --git a/src_assets/common/assets/web/configs/tabs/Inputs.vue b/src_assets/common/assets/web/configs/tabs/Inputs.vue index d7930be8..e8487cbe 100644 --- a/src_assets/common/assets/web/configs/tabs/Inputs.vue +++ b/src_assets/common/assets/web/configs/tabs/Inputs.vue @@ -177,6 +177,17 @@ const config = ref(props.config) v-model="config.enable_input_only_mode" default="false" > + + +
+ + diff --git a/src_assets/common/assets/web/public/assets/locale/en.json b/src_assets/common/assets/web/public/assets/locale/en.json index 0ec6f7c5..056573c1 100644 --- a/src_assets/common/assets/web/public/assets/locale/en.json +++ b/src_assets/common/assets/web/public/assets/locale/en.json @@ -255,6 +255,8 @@ "enable_discovery_desc": "When disabled, you'll need to manually enter host IP on the client to pair.", "enable_input_only_mode": "Enable Input Only Mode", "enable_input_only_mode_desc": "Add an Input Only app entry. When enabled, the app list will only show the current running app and the Input Only entry when streaming. The Input Only entry will not receive any image or audio. Useful for operating the desktop on TV or connecting peripherals which the TV doesn't support with a phone.", + "enable_rumble_messages_to_controllers": "Enable Rumble Messages to Controllers", + "enable_rumble_messages_to_controllers_desc": "Enable Rumble Messages to Controllers", "enable_pairing": "Enable Pairing", "enable_pairing_desc": "Enable pairing for the Moonlight client. This allows the client to authenticate with the host and establish a secure connection.", "encoder": "Force a Specific Encoder",