wirekang/mouseable

Diagonal movements are odd

Opened this issue · 3 comments

  1. Somehow they seem to not follow the normal acceleration rules, instead being very slow.
  2. Depressing an orthogonal movement together with a diagonal one makes the mouse fly orthogonally at exceptional speed.

It seems like if you press up + left at the exact same time, the horizontal and vertical velocity will be the same. If you input e.g. up slightly later, then the horizontal speed will be way larger than the vertical one.

I think you might want to keep the current speed when a vertical direction button is pressed in addition to a horizontal one, and simply change direction.

Fixed it.

@wirekang I'm not sure if I should open a new issue for this, but even in 2.0 there are some odd things going on with multiple simultaneous direction presses. Take the following scenario:

  • Hold down and left to move diagonally down-left.
  • Push right momentarily.
  • This stops the cursor dead in its tracks, even if you release the key for right.
  • You can't move the cursor until you release all but one directional keys.

Pushing opposite directions on a keyboard can happen fairly easily when switching directions, even if only for a brief amount of time. What seems like a straightforward way to fix this is to have opposite directions cancel each other out: if you're pressing up and down at the same time, it should be as if you were pushing neither; and so on.