This repository has been archived on 2023-05-28. You can view files and clone it, but cannot push or open issues/pull-requests.
SkyHook-Unity/Runtime/Event.cs

39 lines
948 B
C#
Raw Normal View History

2022-11-03 21:18:05 +09:00
using System.Diagnostics.CodeAnalysis;
2022-11-03 20:55:22 +09:00
using System.Runtime.InteropServices;
namespace SkyHook
{
/// <summary>
/// Recorded key updates from SkyHook.
/// </summary>
2022-11-03 20:55:22 +09:00
[StructLayout(LayoutKind.Sequential)]
2022-11-03 21:18:05 +09:00
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
2022-11-03 20:55:22 +09:00
public struct SkyHookEvent
{
2022-11-03 21:18:05 +09:00
/// <summary>
/// When the key's state was updated.
2022-11-03 21:18:05 +09:00
/// </summary>
public readonly ulong Time;
/// <summary>
/// Whether the key is pressed or released.
2022-11-03 21:18:05 +09:00
/// </summary>
public readonly EventType Type;
/// <summary>
2022-11-06 22:11:11 +09:00
/// The identified key label from the native assembly.
2022-11-03 21:18:05 +09:00
/// </summary>
2022-11-06 22:11:11 +09:00
public readonly ushort Label;
/// <summary>
/// The key number that was pressed or released.
/// </summary>
public readonly ushort Key;
2022-11-03 20:55:22 +09:00
}
/// <summary>
/// The type of <see cref="SkyHookEvent"/>'s event.
/// </summary>
2022-11-03 20:55:22 +09:00
public enum EventType
{
KeyPressed,
KeyReleased
}
}