End Google Ads 201810 - BS.net 01 --> Hi,
I want to confine mouse movement. Let's say I want to confine mouse movement to x-direction (so only horizontal movement is possible) when pressing a certain button. This should work globally. What I mean with that is, that I want to use this in any windows program. Let's take MS Paint as an example: When my program runs and I press the certain button, the movement of the mouse should be restricted to horizontal movement. So when drawing a straight horizontal line should be the result.

My research so far led me to ClipCursor, but ClipCursor seems to only affect the mousecursor, not the raw data. So returning to the example of MS Paint the following happens:
The cursor moves on the horizontal line, but the mouse data received by paint is different: So if you move the mouse slightly in y-direction this still affects the line drawn, also the mouse cursor itself does not indicate that (stays on the straight line). So the result is not a straight line as expected.

Does anybody know how to solve that problem ? (as ClipCursor does not confine the raw data sent to an application, it seems to be the wrong routine for doing that)

Thanks in advance.