Created
July 2, 2017 12:01
-
-
Save tarukosu/26ee2a9f3af23256ab5068865584f962 to your computer and use it in GitHub Desktop.
MouseHookTest.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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