javamacrospascalmouse-hook

Picking up pascal mouse movements in java


I have a macro tool that runs using pascal. I need to track the movements of the mouse while the program is running over very long periods of time. I wrote a basic mouse recorder in java that draws the movements and clicks in slow motion so they are easier to analyze, using jnativehook. It works fine when I move the mouse manually, but it does not pick up mouse movements from pascal. It does however pick up mouse clicks from pascal.

How can I pick up mouse movements made by a pascal macro tool in Java?


Solution

  • The issue is how the events are generated in Pascal and are going to depend on the platform you are working with. I would suggest using the event posting functionality in JNativeHook as it will always be able to pick up the events it generates. You can still send events that the library can pick up outside of the library, but on some platforms it requires using a specific API as some methods cannot be picked up by the listener on specific platforms.