Skip to content

Commit

Permalink
- Improved KeyboardHook logging
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis- committed Feb 8, 2020
1 parent 5d2293f commit 0574ab3
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,19 @@ private IntPtr LowLevelKeyboardProc(int nCode,
{
scopeMatches = false;
}

// ReSharper disable once ConditionIsAlwaysTrueOrFalse
else if (_elWdwHandle == null || _elWdwHandle == IntPtr.Zero)
{
LogTo.Warning(
$"KeyboardHook: HotKey {hk} requested with scope {Enum.GetName(typeof(HotKeyScope), hkReg.Scope)}, but _elWdwHandle is {foregroundWdwHandle}. Trying to refresh.");

OnElementWindowAvailable();

// ReSharper disable once ConditionIsAlwaysTrueOrFalse
if (_elWdwHandle == null || _elWdwHandle == IntPtr.Zero)
scopeMatches = false;
}

else if (hkReg.Scope == HotKeyScope.SMBrowser && foregroundWdwHandle != _elWdwHandle)
{
Expand Down

0 comments on commit 0574ab3

Please sign in to comment.