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; using System.Runtime.InteropServices;
namespace SkyHook namespace SkyHook
{ {
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public struct SkyHookEvent public struct SkyHookEvent
{ {
/// <summary> public ulong Time;
/// When the key was pressed public short Type;
/// </summary> public uint Key;
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 enum EventType public enum EventType

View File

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

View File

@ -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 Update() private void Run()
{ {
if (RequireFocus) if (requireFocus)
{ {
_isFocused = Application.isFocused; IsFocused = Application.isFocused;
} }
} }
} }

Binary file not shown.