repeats / Repeat

Cross-platform mouse/keyboard record/replay and automation hotkeys/macros creation, and more advanced automation features.
Apache License 2.0
1.03k stars 76 forks source link

Mouse position during playback different from mouse position during recording #36

Closed achimmihca closed 2 years ago

achimmihca commented 2 years ago

This project looks useful to me. Sadly, the recorded mouse position seems off.

I record mouse and keyboard actions using the record button. When I click the play button, then the mouse positions are different to what I did during recording. The position is only slightly off. This could be the difference in position between the record button (which I click to start recording) and the play button (which I click to play the recording).

Which mouse coordinates are recorded, global or relative? I need global mouse coordinates.

Not further that I use Windows 10 with a screen scaling factor of 125% (screen size 2560x1440 pixels). Could this be an issue?

achimmihca commented 2 years ago

In another recording software that I tried, DPI awareness was the culprit: https://github.com/Zuzu-Typ/Input-Recorder/issues/4 Maybe it is a similar issue here.

hptruong93 commented 2 years ago

The screen scaling factor is the problem. I was able to reproduce this with by setting to 125% as well.

This is very interesting because the mouse position displayed is actually correct, so this discrepancy must come from the low level hook. I'll take a look and try to fix the lower level hook.

hptruong93 commented 2 years ago

I found a solution. Will update this weekend and have a release for this.

hptruong93 commented 2 years ago

Should be fixed with 2eaeaed0fdefa38543212ee182c26feb5f7c40ce

hptruong93 commented 2 years ago

I have 5.6.2 for Pre-Release (link https://github.com/repeats/Repeat/releases/tag/v5.6.2). I'll do some testing this week before marking it as official release, but feel free to use that to see whether it solves the problem.

You'll need to enable the "Use Java AWT for mouse position" option and restart for it to take effect. image

achimmihca commented 2 years ago

I tried https://github.com/repeats/Repeat/releases/tag/v5.6.2 but I am unable to set this option. A popup appears telling me: "This requires a restart to take effect."

But the checkbox is still not checked afterwards. It is also not set after I kill and restart Repeat_5_6_2.jar

How do I set this option?

The recording and playback behavior also did not change. I think the option has not been enabled at all.

hptruong93 commented 2 years ago

Could you try clicking on the box itself (not the text, but inside the box)? Like this image

For some reason the HTML checkbox behavior is a bit weird on menu items.

achimmihca commented 2 years ago

Indeed, clicking the checkbox instead of the text works.

I also had to shut down the app via "File > Exit" (just killing the process does not persist the setting)

Anyway, with the checkbox set, the mouse position is correct during playback. Thanks!