Skip to content

Instantly share code, notes, and snippets.

@tarukosu
Created July 2, 2017 12:01
Show Gist options
  • Select an option

  • Save tarukosu/26ee2a9f3af23256ab5068865584f962 to your computer and use it in GitHub Desktop.

Select an option

Save tarukosu/26ee2a9f3af23256ab5068865584f962 to your computer and use it in GitHub Desktop.
MouseHookTest.cs
using MMFrame.Windows.GlobalHook;
using UnityEngine;
namespace MMFrame
{
public class MouseHookTest : MonoBehaviour
{
void Start()
{
if (MouseHook.IsHooking)
{
return;
}
MouseHook.AddEvent(HookMouseTest);
MouseHook.Start();
//MouseHook.Disable();
}
void HookMouseTest(ref MMFrame.Windows.GlobalHook.MouseHook.StateMouse s)
{
Debug.Log(s.X + ", " + s.Y);
Debug.Log(s.Stroke);
}
private void OnApplicationQuit()
{
if (MouseHook.IsHooking)
{
MouseHook.Stop();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment