diff --git a/FreeControl/FreeControl.csproj b/FreeControl/FreeControl.csproj index 435f844..b1bd206 100644 --- a/FreeControl/FreeControl.csproj +++ b/FreeControl/FreeControl.csproj @@ -283,7 +283,7 @@ - + diff --git a/FreeControl/Main.Designer.cs b/FreeControl/Main.Designer.cs index 923f082..1423696 100644 --- a/FreeControl/Main.Designer.cs +++ b/FreeControl/Main.Designer.cs @@ -350,7 +350,8 @@ private void InitializeComponent() resources.GetString("comboMbps.Items2"), resources.GetString("comboMbps.Items3"), resources.GetString("comboMbps.Items4"), - resources.GetString("comboMbps.Items5")}); + resources.GetString("comboMbps.Items5"), + resources.GetString("comboMbps.Items6")}); this.comboMbps.Name = "comboMbps"; this.comboMbps.Style = Sunny.UI.UIStyle.Custom; this.comboMbps.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; diff --git a/FreeControl/Main.cs b/FreeControl/Main.cs index cbb6bfc..afa9342 100644 --- a/FreeControl/Main.cs +++ b/FreeControl/Main.cs @@ -25,7 +25,7 @@ public partial class Main : UIForm /// /// scrcpy版本 /// - public static readonly string ScrcpyVersion = "scrcpy-win64-v2.3.1"; + public static readonly string ScrcpyVersion = "scrcpy-win64-v2.4"; /// /// scrcpy路径 /// @@ -266,6 +266,10 @@ public void InitPdone() cbxShowTouches.ValueChanged += CommonCbx_ValueChanged; cbxReadOnly.ValueChanged += CommonCbx_ValueChanged; cbxAudioEnabled.ValueChanged += cbxAudioEnabled_ValueChanged; + + uiLabel4.DoubleClick += (sender, e) => Process.Start(Logger.path); + uiLabel3.DoubleClick += (sender, e) => Process.Start(UserDataPath); + #endregion #region 设置标题和图标 @@ -338,7 +342,7 @@ private void ExtractResource(bool reload = false) if (!Directory.Exists(ScrcpyPath)) { Directory.CreateDirectory(ScrcpyPath); - File.WriteAllBytes(ScrcpyPath + tempFileName, Properties.Resources.scrcpy_win64_v2_3_1); + File.WriteAllBytes(ScrcpyPath + tempFileName, Properties.Resources.scrcpy_win64_v2_4); // 解压缩 ZipFile.ExtractToDirectory(ScrcpyPath + tempFileName, UserDataPath); // 解压完成删除压缩包 @@ -404,10 +408,9 @@ private void StartButtonClick(object sender, EventArgs e) } // 设置标题 StartParameters.Add($"--window-title \"{Info.ScrcpyTitle}\""); - // 设置为文本注入 - StartParameters.Add($"--prefer-text"); - // 设置为按键注入 - // StartParameters.Add($"--raw-key-events"); + // 设置断开后锁定屏幕 + StartParameters.Add("--power-off-on-close"); + StartParameters.Add(_Setting.CustomArgs); if (_Setting.AudioEnabled == false) StartParameters.Add(_Setting.GetDesc("AudioEnabled"));// 不转发音频 // 其他参数 @@ -514,14 +517,8 @@ private void RunScrcpy() } } }; - scrcpy.ErrorDataReceived += (ss, ee) => - { - if (ee.Data.IsNotNull()) - { - Logger.Info($"{ee.Data}", "scrcpy"); - } - }; - scrcpy.Exited += (ss, ee) => + + void exitHandle() { SetUserData(_Setting);// 关闭scrcpy后保存一下配置文件 if (_Setting.EnableSwitchIME && _Setting.IME != 0 && _Setting.IMEOrigin.IsNotNull()) @@ -533,7 +530,20 @@ private void RunScrcpy() ButtonHandle(false); LoadHistoryIPs(true); ShowMessage(I18n.msgExit); + } + + scrcpy.ErrorDataReceived += (ss, ee) => + { + if (ee.Data.IsNotNull()) + { + Logger.Info($"{ee.Data}", "scrcpy"); + if (ee.Data.Contains("ERROR")) + { + exitHandle(); + } + } }; + scrcpy.Exited += (ss, ee) => exitHandle(); scrcpy.BeginErrorReadLine(); scrcpy.BeginOutputReadLine(); @@ -767,6 +777,9 @@ private void ComboMbps_SelectedValueChanged(object sender, EventArgs e) case 5: _Setting.BitRate = "-b 4M"; break; + case 6: + _Setting.BitRate = "-b 1M"; + break; default: _Setting.BitRate = ""; break; diff --git a/FreeControl/Main.resx b/FreeControl/Main.resx index d707c30..516b892 100644 --- a/FreeControl/Main.resx +++ b/FreeControl/Main.resx @@ -151,7 +151,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00L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QAxgBICQA AzkBXgNJAfYDGgH/A1UBrzAAAx4BKgNdAd8DvwH/A18B0AMYASAkAAM5AV4DYgH2A78B/wNVAa8kAAMc AScDSQH2AxoB/wMaAf8DXwHaA10ByQNgAfMDGgH/AxwBJxwAA10B3AMaAf8DYQHrA1sBzQNeAfsDGgH/ @@ -827,6 +827,9 @@ 4Mbps + + 1Mbps + 496, 50 diff --git a/FreeControl/Properties/AssemblyInfo.cs b/FreeControl/Properties/AssemblyInfo.cs index 51f2c18..8e6b379 100644 --- a/FreeControl/Properties/AssemblyInfo.cs +++ b/FreeControl/Properties/AssemblyInfo.cs @@ -33,5 +33,5 @@ //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] //[assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("1.6.9")] -[assembly: AssemblyVersion("1.6.9")] +[assembly: AssemblyFileVersion("1.7.0")] +[assembly: AssemblyVersion("1.7.0")] diff --git a/FreeControl/Properties/Resources.Designer.cs b/FreeControl/Properties/Resources.Designer.cs index a28ca09..68e844b 100644 --- a/FreeControl/Properties/Resources.Designer.cs +++ b/FreeControl/Properties/Resources.Designer.cs @@ -83,9 +83,9 @@ internal static System.Drawing.Icon pcm { /// /// 查找 System.Byte[] 类型的本地化资源。 /// - internal static byte[] scrcpy_win64_v2_3_1 { + internal static byte[] scrcpy_win64_v2_4 { get { - object obj = ResourceManager.GetObject("scrcpy_win64_v2_3_1", resourceCulture); + object obj = ResourceManager.GetObject("scrcpy_win64_v2_4", resourceCulture); return ((byte[])(obj)); } } diff --git a/FreeControl/Properties/Resources.resx b/FreeControl/Properties/Resources.resx index 6ebc932..ca4c118 100644 --- a/FreeControl/Properties/Resources.resx +++ b/FreeControl/Properties/Resources.resx @@ -124,8 +124,8 @@ ..\Resources\pcm.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\scrcpy-win64-v2.3.1.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\scrcpy-win64-v2.4.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\shortcut_en.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/FreeControl/Resources/en.FreeControl.resources.dll b/FreeControl/Resources/en.FreeControl.resources.dll index be84e90..7b04f03 100644 Binary files a/FreeControl/Resources/en.FreeControl.resources.dll and b/FreeControl/Resources/en.FreeControl.resources.dll differ diff --git a/FreeControl/Resources/scrcpy-win64-v2.3.1.zip b/FreeControl/Resources/scrcpy-win64-v2.4.zip similarity index 64% rename from FreeControl/Resources/scrcpy-win64-v2.3.1.zip rename to FreeControl/Resources/scrcpy-win64-v2.4.zip index 7f31816..3b43689 100644 Binary files a/FreeControl/Resources/scrcpy-win64-v2.3.1.zip and b/FreeControl/Resources/scrcpy-win64-v2.4.zip differ diff --git a/FreeControl/Setting.cs b/FreeControl/Setting.cs index dfee016..f71565a 100644 --- a/FreeControl/Setting.cs +++ b/FreeControl/Setting.cs @@ -206,5 +206,15 @@ public List ControllerButton /// 心跳间隔 单位:毫秒 /// public int Heartbeat { get; set; } = 60000; + + /// + /// 退出时锁屏 + /// + public bool PowerOffOnClose { get; set; } = true; + + /// + /// 自定义参数 + /// + public string CustomArgs { get; set; } = "--keyboard=uhid"; } }