Author Topic: Mouse control messed up after using cursor move command  (Read 935 times)

Sparky

  • Newbie
  • *
  • Posts: 2
Mouse control messed up after using cursor move command
« on: May 02, 2022, 11:31:16 AM »
I'm trying to create a command that will click on an element of the UI in a game for which there is no keyboard shortcut. When I use the command "Move mouse cursor to screen coordinates", the command works successfully and clicks on the button, but from then on controlling the camera with the actual mouse doesn't work. Something goes wrong with the mapping between the mouse position and the camera, so that moving the physical mouse makes the camera move strangely. I have to exit the game and restart to fix the camera.

I would really appreciate any help you could give me in debugging this.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Mouse control messed up after using cursor move command
« Reply #1 on: May 02, 2022, 11:38:58 AM »
...which game, specifically?


You could try saving the current position of the mouse cursor, moving it to the UI element that needs to be clicked, and then moving it back to the saved position, to see if that maintains normal camera behavior.

Otherwise, if the input system of this game doesn't handle the mouse cursor being set directly to an absolute position, you could try using relative movement (as mentioned here).

Sparky

  • Newbie
  • *
  • Posts: 2
Re: Mouse control messed up after using cursor move command
« Reply #2 on: May 02, 2022, 11:55:04 AM »
Thanks for your help. The game in question is Kingdoms of Amalur: Reckoning (the original version, not the remaster). I tried various versions of ways of inputting the coordinates. Using the link you gave, I tried adding a command to briefly move the mouse before executing the rest of the commands. So the sequence is now:

Move mouse left 1 relative mickeys from cursor position
Save current mouse location
Move cursor to screen coordinates (939, 389)
Click left mouse button
Recall saved mouse location

Whether or not I include the first line or the two cursor save and recall lines, the result is the same: after executing the command, the camera goes into a wild 360° spinning. From then on, the camera no longer properly tracks the mouse.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Mouse control messed up after using cursor move command
« Reply #3 on: May 02, 2022, 11:58:40 AM »
I was referring to the "The mouse cursor position cannot be set using specific coordinates in other games" section.

When moving the mouse cursor to an absolute position is not feasible, you'll need to consider only using relative movement.