attractplus icon indicating copy to clipboard operation
attractplus copied to clipboard

Update mouse movement handling:

Open Chadnaut opened this issue 9 months ago • 2 comments

  • Separate axis monitoring to prevent direction blocking
  • Capture pointer movements outside the window to prevent lost directions
  • Pointer no longer confined to threshold region

Basically changed ALL the MouseMoved handling - requires thorough testing!

Chadnaut avatar Apr 01 '25 15:04 Chadnaut

While you're at mouse events would you please take a look at this PR? https://github.com/oomek/attractplus/pull/108/files

oomek avatar Apr 01 '25 17:04 oomek

I should have added that up front - this PR is specifically to fix that issue

  • https://github.com/oomek/attractplus/issues/107
  • https://github.com/oomek/attractplus/pull/108/files

Chadnaut avatar Apr 02 '25 00:04 Chadnaut

@oomek Why was this branch deleted?

Chadnaut avatar Apr 22 '25 15:04 Chadnaut

I didn't

oomek avatar Apr 22 '25 15:04 oomek

My fault. Restored, fetch

oomek avatar Apr 22 '25 15:04 oomek

Testing. I've had no idea that the mouse pointer is locked to the centre of the screen when the mouse movement is bound to Up/Down controls. Looking good so far. Can you please explain the other issues it fixes, I'm not able to reproduce.

oomek avatar Apr 23 '25 11:04 oomek

  1. The priority of the mouse moved event feels inconsistent

The old capture region is a small box in the center of the window. When the mouse escapes this box it triggers a direction, and the mouse is reset to the center.

If you move the mouse diagonally, it will hit one edge of the box before the other, then reset. For example, the "right" direction hits moments before the "up" direction, and all "up" progress is lost when reset.

  1. If I spin the spinner too fast, it gets "stuck"

When the mouse is moved quickly it has a chance to escape the window. Although AM still tracks it, it doesn't trigger the capture region reset.

Chadnaut avatar Apr 23 '25 12:04 Chadnaut

To reproduce:

  1. Set the mouse up/down to control game prev/next.
  2. Move mouse up/right - but more right than up. "Right" triggers a cursor reset, causing to "up" to never register.
  3. Mouse the mouse very fast to escape the window. Up/down no longer registers prev/next.

Chadnaut avatar Apr 23 '25 13:04 Chadnaut