fix: xml docs

feat: use label
develop
CrackThrough 2022-11-06 22:11:11 +09:00
parent 9d97a7ce72
commit 58581a7c53
2 changed files with 20 additions and 7 deletions

View File

@ -8,17 +8,21 @@ namespace SkyHook
public struct SkyHookEvent public struct SkyHookEvent
{ {
/// <summary> /// <summary>
/// When the key was pressed /// When the key was pressed.
/// </summary> /// </summary>
public readonly ulong Time; public readonly ulong Time;
/// <summary> /// <summary>
/// The key is pressed or released /// The key is pressed or released.
/// </summary> /// </summary>
public readonly EventType Type; public readonly EventType Type;
/// <summary> /// <summary>
/// The key number that was pressed or released /// The identified key label from the native assembly.
/// </summary> /// </summary>
public readonly uint Key; public readonly ushort Label;
/// <summary>
/// The key number that was pressed or released.
/// </summary>
public readonly ushort Key;
} }
public enum EventType public enum EventType

View File

@ -13,7 +13,8 @@ namespace SkyHook
public static bool IsFocused; public static bool IsFocused;
/// <summary> /// <summary>
/// Whether or not the event will be received only if the game window is focused. /// Whether or the event will be received only if the game window is focused.
/// Note that only down key events will be ignored.
/// </summary> /// </summary>
// ReSharper disable once MemberCanBePrivate.Global // ReSharper disable once MemberCanBePrivate.Global
// ReSharper disable once FieldCanBeMadeReadOnly.Global // ReSharper disable once FieldCanBeMadeReadOnly.Global
@ -22,13 +23,15 @@ namespace SkyHook
public bool isHookActive; public bool isHookActive;
/// <summary> /// <summary>
/// The key updated event data /// Your callback for each key updated events.
/// Use <see cref="UnityEvent.AddListener"/> to register your callback.
/// </summary> /// </summary>
// ReSharper disable once MemberCanBePrivate.Global // ReSharper disable once MemberCanBePrivate.Global
public static readonly UnityEvent<SkyHookEvent> KeyUpdated = new(); public static readonly UnityEvent<SkyHookEvent> KeyUpdated = new();
/// <summary> /// <summary>
/// The instance of sky hook manager. The instance will be created if it does not exist /// The instance of <see cref="SkyHookManager"/>.
/// A new instance will be created if it does not exist.
/// </summary> /// </summary>
// ReSharper disable once MemberCanBePrivate.Global // ReSharper disable once MemberCanBePrivate.Global
public static SkyHookManager Instance public static SkyHookManager Instance
@ -105,11 +108,17 @@ namespace SkyHook
isHookActive = false; isHookActive = false;
} }
/// <summary>
/// Starts the native hook.
/// </summary>
public static void StartHook() public static void StartHook()
{ {
Instance._StartHook(); Instance._StartHook();
} }
/// <summary>
/// Stops the native hook.
/// </summary>
public static void StopHook() public static void StopHook()
{ {
Instance._StopHook(); Instance._StopHook();