Compare commits
No commits in common. "a22bd2ba7eb39f75a76c3893f11e8281b1596a58" and "8d3287c36cec2be1336fa6b7f4776530631e85b5" have entirely different histories.
a22bd2ba7e
...
8d3287c36c
|
@ -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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "SkyHook.Unity",
|
||||
"rootNamespace": "SkyHook",
|
||||
"rootNamespace": "",
|
||||
"references": [],
|
||||
"includePlatforms": [
|
||||
"Editor",
|
||||
|
|
|
@ -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.
Reference in New Issue