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

33 lines
771 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
{
[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>
2022-11-06 22:11:11 +09:00
/// When the key was pressed.
2022-11-03 21:18:05 +09:00
/// </summary>
public readonly ulong Time;
/// <summary>
2022-11-06 22:11:11 +09:00
/// 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
}
public enum EventType
{
KeyPressed,
KeyReleased
}
}