1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-10-16 06:00:45 +00:00

Added turbo mode

This commit is contained in:
hawkeye 2023-09-29 02:15:02 -04:00
parent 13278106cb
commit b29c236bf9
11 changed files with 113 additions and 79 deletions

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl> <PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.DomainModel</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.DomainModel</RootNamespace>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.9</Version> <Version>4.0.3.0</Version>
<AssemblyVersion>4.0.2.9</AssemblyVersion> <AssemblyVersion>4.0.3.0</AssemblyVersion>
<FileVersion>4.0.2.9</FileVersion> <FileVersion>4.0.3.0</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType> <DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations> <Configurations>Debug;Release;Local</Configurations>

View file

@ -12,6 +12,7 @@ namespace MSFSPopoutPanelManager.DomainModel.Setting
StartMinimized = false; StartMinimized = false;
AutoClose = true; AutoClose = true;
CheckForUpdate = true; CheckForUpdate = true;
TurboMode = false;
InitializeChildPropertyChangeBinding(); InitializeChildPropertyChangeBinding();
} }
@ -26,6 +27,8 @@ namespace MSFSPopoutPanelManager.DomainModel.Setting
public bool CheckForUpdate { get; set; } public bool CheckForUpdate { get; set; }
public bool TurboMode { get; set; }
[JsonIgnore, IgnorePropertyChanged] [JsonIgnore, IgnorePropertyChanged]
public bool AutoStart public bool AutoStart
{ {

View file

@ -14,9 +14,9 @@
<RootNamespace>MSFSPopoutPanelManager.MainApp</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.MainApp</RootNamespace>
<ApplicationIcon>logo.ico</ApplicationIcon> <ApplicationIcon>logo.ico</ApplicationIcon>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.9</Version> <Version>4.0.3.0</Version>
<AssemblyVersion>4.0.2.9</AssemblyVersion> <AssemblyVersion>4.0.3.0</AssemblyVersion>
<FileVersion>4.0.2.9</FileVersion> <FileVersion>4.0.3.0</FileVersion>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages> <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<!-- Publishing options --> <!-- Publishing options -->

View file

@ -181,6 +181,19 @@
<TextBlock Style="{StaticResource TextBlockLabel}">Automatically close the application when exiting MSFS.</TextBlock> <TextBlock Style="{StaticResource TextBlockLabel}">Automatically close the application when exiting MSFS.</TextBlock>
</WrapPanel> </WrapPanel>
</WrapPanel> </WrapPanel>
<WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Turbo Mode</TextBlock>
<Line
Stretch="Fill"
Stroke="Gray"
X2="1" />
<WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.GeneralSetting.TurboMode, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">
<Bold>WARNING!</Bold>
This may not work for all PC. Enable turbo mode to pop out panels as fast as possible. If you have a fast PC, this will let Pop Out Panel Manager executes pop out much faster.</TextBlock>
</WrapPanel>
</WrapPanel>
<WrapPanel Margin="0,0,20,20" Orientation="Vertical"> <WrapPanel Margin="0,0,20,20" Orientation="Vertical">
<TextBlock Style="{StaticResource TextBlockHeading}">Check for Update</TextBlock> <TextBlock Style="{StaticResource TextBlockHeading}">Check for Update</TextBlock>
<Line <Line
@ -189,7 +202,7 @@
X2="1" /> X2="1" />
<WrapPanel> <WrapPanel>
<ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.GeneralSetting.CheckForUpdate, Mode=TwoWay}" Style="{StaticResource ToggleButton}" /> <ToggleButton IsChecked="{Binding AppSettingData.ApplicationSetting.GeneralSetting.CheckForUpdate, Mode=TwoWay}" Style="{StaticResource ToggleButton}" />
<TextBlock Style="{StaticResource TextBlockLabel}">Enable checking for update of application through Github.</TextBlock> <TextBlock Style="{StaticResource TextBlockLabel}">Enable check for application update through Github.</TextBlock>
</WrapPanel> </WrapPanel>
</WrapPanel> </WrapPanel>
</WrapPanel> </WrapPanel>

View file

@ -47,7 +47,7 @@ namespace MSFSPopoutPanelManager.MainApp.ViewModel
run.Foreground = new SolidColorBrush(Colors.IndianRed); run.Foreground = new SolidColorBrush(Colors.IndianRed);
break; break;
case StatusMessageType.Executing: case StatusMessageType.Executing:
run.Foreground = new SolidColorBrush(Colors.Yellow); run.Foreground = new SolidColorBrush(Colors.NavajoWhite);
break; break;
case StatusMessageType.Info: case StatusMessageType.Info:
break; break;

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl> <PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.Orchestration</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.Orchestration</RootNamespace>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.9</Version> <Version>4.0.3.0</Version>
<AssemblyVersion>4.0.2.9</AssemblyVersion> <AssemblyVersion>4.0.3.0</AssemblyVersion>
<FileVersion>4.0.2.9</FileVersion> <FileVersion>4.0.3.0</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType> <DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations> <Configurations>Debug;Release;Local</Configurations>

View file

@ -202,19 +202,19 @@ namespace MSFSPopoutPanelManager.Orchestration
if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_HOME_COCKPIT_MODE) if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_HOME_COCKPIT_MODE)
{ {
SetCockpitZoomLevel(_profileData.ActiveProfile.PanelSourceCockpitZoomFactor); SetCockpitZoomLevel(_profileData.ActiveProfile.PanelSourceCockpitZoomFactor, AppSetting.GeneralSetting.TurboMode);
} }
else else
{ {
WorkflowStepWithMessage.Execute("Resetting camera view", () => WorkflowStepWithMessage.Execute("Resetting camera view", () =>
{ {
ResetCockpitView(); ResetCockpitView(AppSetting.GeneralSetting.TurboMode);
}, true); }, true);
var success = WorkflowStepWithMessage.Execute("Loading custom camera view", () => var success = WorkflowStepWithMessage.Execute("Loading custom camera view", () =>
{ {
return LoadCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding); return LoadCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding, AppSetting.GeneralSetting.TurboMode);
}, true); }, true);
if (!success) if (!success)
@ -222,7 +222,7 @@ namespace MSFSPopoutPanelManager.Orchestration
WorkflowStepWithMessage.Execute("Setting camera zoom level", () => WorkflowStepWithMessage.Execute("Setting camera zoom level", () =>
{ {
SetCockpitZoomLevel(50); SetCockpitZoomLevel(50, AppSetting.GeneralSetting.TurboMode);
}, true); }, true);
} }
} }
@ -249,7 +249,22 @@ namespace MSFSPopoutPanelManager.Orchestration
WorkflowStepWithMessage.Execute(panelConfig.PanelName, () => WorkflowStepWithMessage.Execute(panelConfig.PanelName, () =>
{ {
panelConfig.IsSelectedPanelSource = true; panelConfig.IsSelectedPanelSource = true;
ExecuteCustomPopout(panelConfig, builtInPanelHandles, index++);
if(AppSetting.GeneralSetting.TurboMode)
{
InputEmulationManager.PrepareToPopOutPanel((int)panelConfig.PanelSource.X, (int)panelConfig.PanelSource.Y, AppSetting.GeneralSetting.TurboMode);
PanelSourceOrchestrator.ShowPanelSourceNonEdit(panelConfig);
ExecuteCustomPopout(panelConfig, builtInPanelHandles, index++);
PanelSourceOrchestrator.ClosePanelSourceNonEdit(panelConfig);
}
else
{
PanelSourceOrchestrator.ShowPanelSourceNonEdit(panelConfig);
InputEmulationManager.PrepareToPopOutPanel((int)panelConfig.PanelSource.X, (int)panelConfig.PanelSource.Y, AppSetting.GeneralSetting.TurboMode);
PanelSourceOrchestrator.ClosePanelSourceNonEdit(panelConfig);
ExecuteCustomPopout(panelConfig, builtInPanelHandles, index++);
}
ApplyPanelLocation(panelConfig); ApplyPanelLocation(panelConfig);
panelConfig.IsSelectedPanelSource = false; panelConfig.IsSelectedPanelSource = false;
@ -430,51 +445,44 @@ namespace MSFSPopoutPanelManager.Orchestration
private void ExecuteCustomPopout(PanelConfig panel, List<IntPtr> builtInPanelHandles, int index) private void ExecuteCustomPopout(PanelConfig panel, List<IntPtr> builtInPanelHandles, int index)
{ {
if (panel.PanelType == PanelType.CustomPopout) // There should only be one handle that is not in both builtInPanelHandles vs latestAceAppWindowsWithCaptionHandles
var handle = TryPopOutCustomPanel(panel.PanelSource, builtInPanelHandles, AppSetting.GeneralSetting.TurboMode);
if (handle == IntPtr.Zero)
{ {
PanelSourceOrchestrator.ShowPanelSourceNonEdit(panel); panel.PanelHandle = IntPtr.Zero;
InputEmulationManager.PrepareToPopOutPanel((int)panel.PanelSource.X, (int)panel.PanelSource.Y); return;
PanelSourceOrchestrator.ClosePanelSourceNonEdit(panel); }
// There should only be one handle that is not in both builtInPanelHandles vs latestAceAppWindowsWithCaptionHandles // Unable to pop out panel, the handle was previously popped out's handle
var handle = TryPopOutCustomPanel(panel.PanelSource, builtInPanelHandles); if (_profileData.ActiveProfile.PanelConfigs.Any(p => p.PanelHandle.Equals(handle)) || handle.Equals(WindowProcessManager.SimulatorProcess.Handle) || handle == IntPtr.Zero)
{
panel.PanelHandle = IntPtr.Zero;
return;
}
if (handle == IntPtr.Zero) panel.PanelHandle = handle;
{ WindowActionManager.SetWindowCaption(panel.PanelHandle, $"{panel.PanelName} (Custom)");
panel.PanelHandle = IntPtr.Zero;
return;
}
// Unable to pop out panel, the handle was previously popped out's handle // First time popping out
if (_profileData.ActiveProfile.PanelConfigs.Any(p => p.PanelHandle.Equals(handle)) || handle.Equals(WindowProcessManager.SimulatorProcess.Handle) || handle == IntPtr.Zero) if (panel.Width == 0 && panel.Height == 0)
{ {
panel.PanelHandle = IntPtr.Zero; var rect = WindowActionManager.GetWindowRectangle(panel.PanelHandle);
return; panel.Top = 0 + index * 30;
} panel.Left = 0 + index * 30;
panel.Width = rect.Width;
panel.PanelHandle = handle; panel.Height = rect.Height;
WindowActionManager.SetWindowCaption(panel.PanelHandle, $"{panel.PanelName} (Custom)");
// First time popping out
if (panel.Width == 0 && panel.Height == 0)
{
var rect = WindowActionManager.GetWindowRectangle(panel.PanelHandle);
panel.Top = 0 + index * 30;
panel.Left = 0 + index * 30;
panel.Width = rect.Width;
panel.Height = rect.Height;
}
} }
} }
private IntPtr TryPopOutCustomPanel(PanelSource panelSource, List<IntPtr> builtInPanelHandles) private IntPtr TryPopOutCustomPanel(PanelSource panelSource, List<IntPtr> builtInPanelHandles, bool isTurbo)
{ {
// Try to pop out 3 times before failure with 1/2 second wait in between // Try to pop out 5 times before failure with 1/2 second wait in between
int count = 0; int count = 0;
do do
{ {
InputEmulationManager.PopOutPanel((int)panelSource.X, (int)panelSource.Y, AppSetting.PopOutSetting.UseLeftRightControlToPopOut); InputEmulationManager.PopOutPanel((int)panelSource.X, (int)panelSource.Y, AppSetting.PopOutSetting.UseLeftRightControlToPopOut, isTurbo);
var latestAceAppWindowsWithCaptionHandles = WindowActionManager.GetWindowsByPanelType(new List<PanelType>() { PanelType.BuiltInPopout }); var latestAceAppWindowsWithCaptionHandles = WindowActionManager.GetWindowsByPanelType(new List<PanelType>() { PanelType.BuiltInPopout });
// There should only be one handle that is not in both builtInPanelHandles vs latestAceAppWindowsWithCaptionHandles // There should only be one handle that is not in both builtInPanelHandles vs latestAceAppWindowsWithCaptionHandles
@ -486,7 +494,7 @@ namespace MSFSPopoutPanelManager.Orchestration
Thread.Sleep(500); Thread.Sleep(500);
count++; count++;
} }
while (count < 3); while (count < 5);
return IntPtr.Zero; return IntPtr.Zero;
} }
@ -548,19 +556,19 @@ namespace MSFSPopoutPanelManager.Orchestration
case AfterPopOutCameraViewType.CockpitCenterView: case AfterPopOutCameraViewType.CockpitCenterView:
WorkflowStepWithMessage.Execute("Resetting camera view", () => WorkflowStepWithMessage.Execute("Resetting camera view", () =>
{ {
ResetCockpitView(); ResetCockpitView(AppSetting.GeneralSetting.TurboMode);
}, true); }, true);
break; break;
case AfterPopOutCameraViewType.CustomCameraView: case AfterPopOutCameraViewType.CustomCameraView:
WorkflowStepWithMessage.Execute("Resetting camera view", () => WorkflowStepWithMessage.Execute("Resetting camera view", () =>
{ {
ResetCockpitView(); ResetCockpitView(AppSetting.GeneralSetting.TurboMode);
}, true); }, true);
WorkflowStepWithMessage.Execute("Loading custom camera view", () => WorkflowStepWithMessage.Execute("Loading custom camera view", () =>
{ {
return LoadCustomView(AppSetting.PopOutSetting.AfterPopOutCameraView.KeyBinding); return LoadCustomView(AppSetting.PopOutSetting.AfterPopOutCameraView.KeyBinding, AppSetting.GeneralSetting.TurboMode);
}, true); }, true);
break; break;
@ -573,25 +581,25 @@ namespace MSFSPopoutPanelManager.Orchestration
return ActiveProfile.PanelConfigs.Count(p => p.IsPopOutSuccess != null && (bool)p.IsPopOutSuccess) != ActiveProfile.PanelConfigs.Count(p => p.IsPopOutSuccess != null); return ActiveProfile.PanelConfigs.Count(p => p.IsPopOutSuccess != null && (bool)p.IsPopOutSuccess) != ActiveProfile.PanelConfigs.Count(p => p.IsPopOutSuccess != null);
} }
private void ResetCockpitView() private void ResetCockpitView(bool isTurboMode)
{ {
int retry = 10; int retry = 10;
for (var i = 0; i < retry; i++) for (var i = 0; i < retry; i++)
{ {
FlightSimOrchestrator.ResetCameraView(); FlightSimOrchestrator.ResetCameraView();
Thread.Sleep(1000); // wait for flightsimdata to be updated Thread.Sleep(isTurboMode ? 600 : 1000); // wait for flightsimdata to be updated
if (_flightSimData.CameraViewTypeAndIndex1 == 0) // 0 = reset view if (_flightSimData.CameraViewTypeAndIndex1 == 0) // 0 = reset view
break; break;
} }
} }
private bool LoadCustomView(string keybinding) private bool LoadCustomView(string keybinding, bool isTurboMode)
{ {
int retry = 10; int retry = 10;
for(var i = 0; i < retry; i++) for(var i = 0; i < retry; i++)
{ {
InputEmulationManager.LoadCustomView(keybinding); InputEmulationManager.LoadCustomView(keybinding);
Thread.Sleep(1000); // wait for flightsimdata to be updated Thread.Sleep(isTurboMode ? 600 : 1000); // wait for flightsimdata to be updated
if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_CUSTOM_CAMERA) // custom camera view enum if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_CUSTOM_CAMERA) // custom camera view enum
return true; return true;
} }
@ -599,13 +607,13 @@ namespace MSFSPopoutPanelManager.Orchestration
return false; return false;
} }
private void SetCockpitZoomLevel(int zoom) private void SetCockpitZoomLevel(int zoom, bool isTurboMode)
{ {
int retry = 10; int retry = 10;
for (var i = 0; i < retry; i++) for (var i = 0; i < retry; i++)
{ {
FlightSimOrchestrator.SetCockpitCameraZoomLevel(zoom); FlightSimOrchestrator.SetCockpitCameraZoomLevel(zoom);
Thread.Sleep(1000); // wait for flightsimdata to be updated Thread.Sleep(isTurboMode ? 600 : 1000); // wait for flightsimdata to be updated
if (_flightSimData.CockpitCameraZoom == zoom) if (_flightSimData.CockpitCameraZoom == zoom)
break; break;

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl> <PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.Shared</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.Shared</RootNamespace>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.9</Version> <Version>4.0.3.0</Version>
<AssemblyVersion>4.0.2.9</AssemblyVersion> <AssemblyVersion>4.0.3.0</AssemblyVersion>
<FileVersion>4.0.2.9</FileVersion> <FileVersion>4.0.3.0</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType> <DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations> <Configurations>Debug;Release;Local</Configurations>

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl> <PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.SimConnectAgent</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.SimConnectAgent</RootNamespace>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.9</Version> <Version>4.0.3.0</Version>
<AssemblyVersion>4.0.2.9</AssemblyVersion> <AssemblyVersion>4.0.3.0</AssemblyVersion>
<FileVersion>4.0.2.9</FileVersion> <FileVersion>4.0.3.0</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType> <DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations> <Configurations>Debug;Release;Local</Configurations>

View file

@ -44,35 +44,40 @@ namespace MSFSPopoutPanelManager.WindowsAgent
PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0); PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
} }
public static void PrepareToPopOutPanel(int x, int y) public static void PrepareToPopOutPanel(int x, int y, bool isTurboMode)
{ {
PInvoke.SetForegroundWindow(WindowProcessManager.SimulatorProcess.Handle); PInvoke.SetForegroundWindow(WindowProcessManager.SimulatorProcess.Handle);
Thread.Sleep(250); Thread.Sleep(isTurboMode ? 0 : 250);
MoveAppWindowFromLeftClickPoint(x, y); MoveAppWindowFromLeftClickPoint(x, y);
// Left click outside the cirlce area to focus game window if(!isTurboMode)
LeftClick(x + 30, y); LeftClick(x + 30, y); // Left click outside the cirlce area to focus game window
// Force cursor reset and focus // Force cursor reset and focus
PInvoke.SetCursorPos(x, y); PInvoke.SetCursorPos(x, y);
Thread.Sleep(500); Thread.Sleep(isTurboMode ? 50 : 500);
} }
public static void PopOutPanel(int x, int y, bool useSecondaryKeys) public static void PopOutPanel(int x, int y, bool useSecondaryKeys, bool isTurbo)
{ {
if (useSecondaryKeys) if (useSecondaryKeys)
{ {
InputSimulator.Keyboard.KeyDown(WindowsInput.Native.VirtualKeyCode.LCONTROL); InputSimulator.Keyboard.KeyDown(WindowsInput.Native.VirtualKeyCode.LCONTROL);
InputSimulator.Keyboard.KeyDown(WindowsInput.Native.VirtualKeyCode.RCONTROL); InputSimulator.Keyboard.KeyDown(WindowsInput.Native.VirtualKeyCode.RCONTROL);
Thread.Sleep(500);
Thread.Sleep(isTurbo ? 0: 500);
PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0); PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
Thread.Sleep(200); Thread.Sleep(200);
PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0); PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
Thread.Sleep(200);
Thread.Sleep(isTurbo ? 0 : 200);
PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0); PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
Thread.Sleep(200); Thread.Sleep(200);
PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0); PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
InputSimulator.Keyboard.KeyUp(WindowsInput.Native.VirtualKeyCode.RCONTROL); InputSimulator.Keyboard.KeyUp(WindowsInput.Native.VirtualKeyCode.RCONTROL);
InputSimulator.Keyboard.KeyUp(WindowsInput.Native.VirtualKeyCode.LCONTROL); InputSimulator.Keyboard.KeyUp(WindowsInput.Native.VirtualKeyCode.LCONTROL);
Thread.Sleep(100); Thread.Sleep(100);
@ -82,14 +87,19 @@ namespace MSFSPopoutPanelManager.WindowsAgent
else else
{ {
InputSimulator.Keyboard.KeyDown(WindowsInput.Native.VirtualKeyCode.RMENU); InputSimulator.Keyboard.KeyDown(WindowsInput.Native.VirtualKeyCode.RMENU);
Thread.Sleep(500);
Thread.Sleep(isTurbo ? 0 : 500);
PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0); PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
Thread.Sleep(200); Thread.Sleep(200);
PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0); PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
Thread.Sleep(200);
Thread.Sleep(isTurbo ? 0 : 200);
PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0); PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
Thread.Sleep(200); Thread.Sleep(200);
PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0); PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
InputSimulator.Keyboard.KeyUp(WindowsInput.Native.VirtualKeyCode.RMENU); InputSimulator.Keyboard.KeyUp(WindowsInput.Native.VirtualKeyCode.RMENU);
Thread.Sleep(100); Thread.Sleep(100);
InputSimulator.Keyboard.KeyUp(WindowsInput.Native.VirtualKeyCode.RMENU); // resend to make sure Alt key is up InputSimulator.Keyboard.KeyUp(WindowsInput.Native.VirtualKeyCode.RMENU); // resend to make sure Alt key is up

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl> <PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.WindowsAgent</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.WindowsAgent</RootNamespace>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.9</Version> <Version>4.0.3.0</Version>
<AssemblyVersion>4.0.2.9</AssemblyVersion> <AssemblyVersion>4.0.3.0</AssemblyVersion>
<FileVersion>4.0.2.9</FileVersion> <FileVersion>4.0.3.0</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType> <DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations> <Configurations>Debug;Release;Local</Configurations>