fix: isFocused is always false
parent
56672b497f
commit
8fd4c05a2f
|
@ -7,7 +7,7 @@ namespace SkyHook
|
||||||
{
|
{
|
||||||
private static SkyHookManager _instance;
|
private static SkyHookManager _instance;
|
||||||
|
|
||||||
private static bool IsFocused;
|
private static bool _isFocused;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether or not the event will be received only if the game window is focused.
|
/// Whether or not the event will be received only if the game window is focused.
|
||||||
|
@ -46,7 +46,7 @@ namespace SkyHook
|
||||||
|
|
||||||
private void HookCallback(SkyHookEvent ev)
|
private void HookCallback(SkyHookEvent ev)
|
||||||
{
|
{
|
||||||
if (RequireFocus && !IsFocused)
|
if (RequireFocus && !_isFocused)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -96,11 +96,11 @@ namespace SkyHook
|
||||||
StopHook();
|
StopHook();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Run()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (RequireFocus)
|
if (RequireFocus)
|
||||||
{
|
{
|
||||||
IsFocused = Application.isFocused;
|
_isFocused = Application.isFocused;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue