Compare commits

..

No commits in common. "a22bd2ba7eb39f75a76c3893f11e8281b1596a58" and "8d3287c36cec2be1336fa6b7f4776530631e85b5" have entirely different histories.

4 changed files with 9 additions and 20 deletions

View File

@ -1,24 +1,13 @@
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
namespace SkyHook
{
[StructLayout(LayoutKind.Sequential)]
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public struct SkyHookEvent
{
/// <summary>
/// When the key was pressed
/// </summary>
public readonly ulong Time;
/// <summary>
/// The key is pressed or released
/// </summary>
public readonly EventType Type;
/// <summary>
/// The key number that was pressed or released
/// </summary>
public readonly uint Key;
public ulong Time;
public short Type;
public uint Key;
}
public enum EventType

View File

@ -1,6 +1,6 @@
{
"name": "SkyHook.Unity",
"rootNamespace": "SkyHook",
"rootNamespace": "",
"references": [],
"includePlatforms": [
"Editor",

View File

@ -7,7 +7,7 @@ namespace SkyHook
{
private static SkyHookManager _instance;
private static bool _isFocused;
private static bool IsFocused;
/// <summary>
/// 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)
{
if (RequireFocus && !_isFocused)
if (RequireFocus && !IsFocused)
{
return;
}
@ -96,11 +96,11 @@ namespace SkyHook
StopHook();
}
private void Update()
private void Run()
{
if (RequireFocus)
if (requireFocus)
{
_isFocused = Application.isFocused;
IsFocused = Application.isFocused;
}
}
}

Binary file not shown.