From 11b31349949add66257616e92eb407afa341a1c8 Mon Sep 17 00:00:00 2001 From: hawkeye Date: Sat, 9 Sep 2023 17:35:17 -0400 Subject: [PATCH] Add time delay for pop out process --- DomainModel/DomainModel.csproj | 6 +++--- MainApp/MainApp.csproj | 6 +++--- Orchestration/Orchestration.csproj | 6 +++--- Shared/Shared.csproj | 6 +++--- SimconnectAgent/SimconnectAgent.csproj | 6 +++--- WindowsAgent/InputEmulationManager.cs | 12 +++++------- WindowsAgent/WindowsAgent.csproj | 6 +++--- 7 files changed, 23 insertions(+), 25 deletions(-) diff --git a/DomainModel/DomainModel.csproj b/DomainModel/DomainModel.csproj index 9720642..39d308e 100644 --- a/DomainModel/DomainModel.csproj +++ b/DomainModel/DomainModel.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.DomainModel x64 - 4.0.2.7 - 4.0.2.7 - 4.0.2.7 + 4.0.2.8 + 4.0.2.8 + 4.0.2.8 win-x64 Embedded Debug;Release;Local diff --git a/MainApp/MainApp.csproj b/MainApp/MainApp.csproj index 93a3882..3e71f46 100644 --- a/MainApp/MainApp.csproj +++ b/MainApp/MainApp.csproj @@ -14,9 +14,9 @@ MSFSPopoutPanelManager.MainApp logo.ico x64 - 4.0.2.7 - 4.0.2.7 - 4.0.2.7 + 4.0.2.8 + 4.0.2.8 + 4.0.2.8 embedded en diff --git a/Orchestration/Orchestration.csproj b/Orchestration/Orchestration.csproj index 7250403..f28b069 100644 --- a/Orchestration/Orchestration.csproj +++ b/Orchestration/Orchestration.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.Orchestration x64 - 4.0.2.7 - 4.0.2.7 - 4.0.2.7 + 4.0.2.8 + 4.0.2.8 + 4.0.2.8 win-x64 Embedded Debug;Release;Local diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index 1b30d1d..69db2b6 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.Shared x64 - 4.0.2.7 - 4.0.2.7 - 4.0.2.7 + 4.0.2.8 + 4.0.2.8 + 4.0.2.8 win-x64 Embedded Debug;Release;Local diff --git a/SimconnectAgent/SimconnectAgent.csproj b/SimconnectAgent/SimconnectAgent.csproj index f18e531..e8a0880 100644 --- a/SimconnectAgent/SimconnectAgent.csproj +++ b/SimconnectAgent/SimconnectAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.SimConnectAgent x64 - 4.0.2.7 - 4.0.2.7 - 4.0.2.7 + 4.0.2.8 + 4.0.2.8 + 4.0.2.8 win-x64 Embedded Debug;Release;Local diff --git a/WindowsAgent/InputEmulationManager.cs b/WindowsAgent/InputEmulationManager.cs index cde1a79..0093903 100644 --- a/WindowsAgent/InputEmulationManager.cs +++ b/WindowsAgent/InputEmulationManager.cs @@ -49,23 +49,20 @@ namespace MSFSPopoutPanelManager.WindowsAgent Debug.WriteLine($"Pop out panel at: {x}/{y} ..."); PInvoke.SetForegroundWindow(WindowProcessManager.SimulatorProcess.Handle); - Thread.Sleep(200); + Thread.Sleep(250); MoveAppWindowFromLeftClickPoint(x, y); LeftClick(x, y); - // Force cursor reset - PInvoke.SetCursorPos(x + 1, y); - Thread.Sleep(100); - - PInvoke.SetCursorPos(x, y); - Thread.Sleep(300); + // Force cursor reset and focus (doubling to make sure) + LeftClick(x, y); if (useSecondaryKeys) { InputSimulator.Keyboard.KeyDown(WindowsInput.Native.VirtualKeyCode.LCONTROL); InputSimulator.Keyboard.KeyDown(WindowsInput.Native.VirtualKeyCode.RCONTROL); + Thread.Sleep(300); PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0); Thread.Sleep(200); PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0); @@ -82,6 +79,7 @@ namespace MSFSPopoutPanelManager.WindowsAgent else { InputSimulator.Keyboard.KeyDown(WindowsInput.Native.VirtualKeyCode.RMENU); + Thread.Sleep(300); PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0); Thread.Sleep(200); PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0); diff --git a/WindowsAgent/WindowsAgent.csproj b/WindowsAgent/WindowsAgent.csproj index 30dc69f..af0beac 100644 --- a/WindowsAgent/WindowsAgent.csproj +++ b/WindowsAgent/WindowsAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.WindowsAgent x64 - 4.0.2.7 - 4.0.2.7 - 4.0.2.7 + 4.0.2.8 + 4.0.2.8 + 4.0.2.8 win-x64 Embedded Debug;Release;Local