I strongly recommend against using the jNativeHook library in debug mode. Everything runs in the Main thread in debug mode and this screws up the library's threading model.
Remember that the event subs that the library raises will NOT be running in the Main thread. If you want to access UI elements from those subs, you have to use Thread.RunOnGuiThread (from the Threading library). The reason for this is that the library would not be able to consume input events if those event subs ran in the Main thread. They need to run in the NativeHook delegate thread to offer event consumption.
Also, killing your application does NOT unregister the NativeHook. It will leave the NativeHook "dangling". Too many dangling NativeHooks in memory will interfere with the function of future NativeHooks and other applications. Reboot your computer to clear them.
Proper way to unregister a NativeHook:
NH.unregisterNativeHook 'this will cause the NH_Unregistered event to be raised
Keep in mind that the NativeHook library will raise an event for every single tiny microscopic mouse movement. The library can provide some filtering but you will probably want to add your own time-based filtering so that you don't spam the Main thread's event queue with requests to update the reported mouse position. I think 10x/sec is probably as fast as you need. An alternative might be to use the jAWTRobot library and a timer to accomplish this. The AWTRobot does not need to be unregistered or anything. You can just kill the program and it will die with the program.