Skip to content

Commit

Permalink
OutputWindow: Improve Clipboard interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoltanar committed Oct 11, 2024
1 parent 9eeb62f commit 14189dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Happy Reader/ViewModel/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private bool MonitorLoop()

private void ClipboardChanged(object sender, EventArgs e)
{
if (TranslatePaused || StaticMethods.CtrlKeyIsHeld()) return;
if (TranslatePaused) return;
if (UserGame?.Process == null) return;
var cpOwner = StaticMethods.GetClipboardOwner();
var noOwner = cpOwner == null;
Expand Down Expand Up @@ -410,7 +410,7 @@ public bool RunTranslation(object sender, TextOutputEventArgs e)
var outputWindow = userGame?.OutputWindow;
if (TranslatePaused) return false;
if (userGame == null || outputWindow == null) return false;
if (StaticMethods.CtrlKeyIsHeld()) return false;
if (!e.FromClipboard && StaticMethods.CtrlKeyIsHeld()) return false;
Logger.Verbose($"{nameof(RunTranslation)} - {e}");
if (userGame.Process == null ||
StaticMethods.DispatchIfRequired(() => outputWindow.ViewModel?.IsClipboardCopy(e) ?? false)) return false;
Expand Down

0 comments on commit 14189dc

Please sign in to comment.