diff --git a/src/process.cpp b/src/process.cpp index 892a1ff1..7acac37e 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -218,6 +218,16 @@ namespace proc { display_device::revert_configuration(); }); + if (!app.gamepad.empty()) { + _saved_input_config = std::make_shared(config::input); + if (app.gamepad == "disabled") { + config::input.controller = false; + } else { + config::input.controller = true; + config::input.gamepad = app.gamepad; + } + } + #ifdef _WIN32 if ( config::video.headless_mode // Headless mode @@ -671,6 +681,11 @@ namespace proc { virtual_display = false; allow_client_commands = false; + if (_saved_input_config) { + config::input = *_saved_input_config; + _saved_input_config.reset(); + } + if (needs_refresh) { refresh(config::stream.file_apps, false); } @@ -1193,6 +1208,7 @@ namespace proc { ctx.use_app_identity = app_node.value("use-app-identity", false); ctx.per_client_app_identity = app_node.value("per-client-app-identity", false); ctx.allow_client_commands = app_node.value("allow-client-commands", true); + ctx.gamepad = app_node.value("gamepad", ""); // Calculate a unique application id. auto possible_ids = calculate_app_id(name, ctx.image_path, i++); diff --git a/src/process.h b/src/process.h index ba3e3937..8d430a96 100644 --- a/src/process.h +++ b/src/process.h @@ -78,6 +78,7 @@ namespace proc { std::string output; std::string image_path; std::string id; + std::string gamepad; bool elevated; bool auto_detach; bool wait_all; @@ -136,6 +137,7 @@ namespace proc { boost::process::v1::environment _env; std::shared_ptr _launch_session; + std::shared_ptr _saved_input_config; std::vector _apps; ctx_t _app; diff --git a/src/rtsp.h b/src/rtsp.h index 57791f21..76eb76a1 100644 --- a/src/rtsp.h +++ b/src/rtsp.h @@ -44,7 +44,6 @@ namespace rtsp_stream { int height; int fps; int gcmap; - int appid; int surround_info; std::string surround_params; bool enable_hdr; diff --git a/src_assets/common/assets/web/apps.html b/src_assets/common/assets/web/apps.html index b4ad7c72..8b35f789 100644 --- a/src_assets/common/assets/web/apps.html +++ b/src_assets/common/assets/web/apps.html @@ -164,12 +164,36 @@
{{ $t('apps.app_name_desc') }}
+
{{ $t('apps.image_desc') }}
+ +
+ + +
{{ $t('config.gamepad_desc') }}
+
+ +
+ + +
{{ $t('apps.exit_timeout_desc') }}
+
- +
{{ $t('apps.resolution_scale_factor_desc') }}
- -
- - -
{{ $t('apps.exit_timeout_desc') }}
-

{{ $t('apps.env_vars_about') }}

@@ -407,15 +431,23 @@ {{ $t('apps.env_sunshine_compatibility') }}
-
{{ $t('apps.env_rtss_cli_example') }} -
cmd /C \path\to\rtss-cli.exe limit:set %APOLLO_CLIENT_FPS%
-
-
{{ $t('apps.env_xrandr_example') }} -
sh -c "xrandr --output HDMI-1 --mode \"${APOLLO_CLIENT_WIDTH}x${APOLLO_CLIENT_HEIGHT}\" --rate ${APOLLO_CLIENT_FPS}"
-
-
{{ $t('apps.env_displayplacer_example') }} -
sh -c "displayplacer "id:<screenId> res:${APOLLO_CLIENT_WIDTH}x${APOLLO_CLIENT_HEIGHT} hz:${APOLLO_CLIENT_FPS} scaling:on origin:(0,0) degree:0""
-
+ + + + + @@ -441,6 +473,7 @@ import { initApp } from './init' import Navbar from './Navbar.vue' import Checkbox from './Checkbox.vue' + import Platformlayout from './PlatformLayout.vue' import { Dropdown } from 'bootstrap/dist/js/bootstrap' const newApp = { @@ -460,12 +493,16 @@ "per-client-app-identity": false, "allow-client-commands": true, "virtual-display": false, + "gamepad": "" } + console.log(Platformlayout) + const app = createApp({ components: { Navbar, - Checkbox + Checkbox, + Platformlayout }, data() { return { 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 3b9095f3..8877baf0 100644 --- a/src_assets/common/assets/web/public/assets/locale/en.json +++ b/src_assets/common/assets/web/public/assets/locale/en.json @@ -7,6 +7,8 @@ "cancel": "Cancel", "cmd_name": "Command Name", "cmd_val": "Command Value", + "default": "Default", + "default_global": "Default (Global)", "disabled": "Disabled", "disabled_def": "Disabled (default)", "disabled_def_cbox": "Default: unchecked", diff --git a/src_assets/common/assets/web/public/assets/locale/zh.json b/src_assets/common/assets/web/public/assets/locale/zh.json index 85292906..8bb6b266 100644 --- a/src_assets/common/assets/web/public/assets/locale/zh.json +++ b/src_assets/common/assets/web/public/assets/locale/zh.json @@ -7,6 +7,8 @@ "cancel": "取消", "cmd_name": "命令名称", "cmd_val": "命令值", + "default": "默认", + "default_global": "默认(全局)", "disabled": "禁用", "disabled_def": "禁用(默认)", "disabled_def_cbox": "默认值:未选",