Matching "Fake" Cursor to system mouse speed? (Suggestion for Screen.clampCursor)

There’s a few similar questions to this, but I thought I’d aggregate my particular question here:

I’m making a gesture heavy game. I’m in the prototyping stage, assessing the feasibility of this game in a web-browser. Ideally, I need to clamp the mouse cursor inside the web player (client requires it to work on web) so that players don’t make errant gestures off the edge of the screen, and start drag dropping files around by mistake when things get hairy in the game*.

To fix that, in my input component’s Update() I use:

	if(!Screen.lockCursor)
		{
		
			if(Input.GetMouseButtonDown(0))
			{
				Screen.lockCursor = true;
			}
		}

When in this mode, the mouse is forced to the center of the screen, and so Input.mousePosition always returns the center of the unity screen (in terms of where it is on the desktop): naturally, it can’t be used to move a fake cursor around. Thus, to figure out how much to move a fake cursor you must use

mouseDelta 		=  new Vector2( Input.GetAxis("Mouse X") , Input.GetAxis("Mouse Y") )

I have also used Edit->Project->Input to adjust the axes Mouse X and Mouse Y to have a sensitivity of 1. At that point, my question is: what, exactly is being returned:

a) In terms of pure signal from the mouse driver, or aggregated delta over the duration of the frame?
b) What input polling rate does unity use for mice in the various OS’s, under the hood?
c) Is the value returned when sensitivity for the axis == 1 essentially “pixel space” (I believe it is, but could do with confirmation).

Purely from observation, this seems like it’s returning raw mouse pixel inputs (I assume accumulated between frames because Debug.Log(mouseDelta.ToString()) sometimes returns fractional values, and iirc, you only actually get integers from mouse hardware? Not sure. I don’t know at what rate the mouse is polled by unity, either. It’d be nice to know.)

The issue here is that the mouse seems to be taking a pretty “pure” (if slightly late - can only update mouse as fast as Update() ) reading from the mouse. This is good for FPS games, but using this approach to fake a cursor is problematic: different OS’s will do different forms of smoothing or acceleration (many bothans have died trying to get rid of mouse smoothing on Macs when playing TF2), and if your mouse cursor behaves differently from what you have set up in your OS, especially in a cursor based game, you’re going to feel it (and personally, I feel good Kinaesthetics should be a high priority in just about any game, as the fundamental subconscious connection is the foundation to feeling in tune with the game system).

Obviously, this is not really a problem if you’re not locking the cursor and faking your own, but I hope there are options so that this approach isn’t ruled out in this engine.

What are my options with regard to input polling? Would unity ever consider allowing us deeper options to input stuff?

The more I think about it, the less likely it is to “fake” the OS’s inherent behaviour (since acceleration in the OS might require actual mouse position displacement to occur, and Screen.lockCursor effectively shuts that down).

Final suggestion: Screen.lockCursor does exist (which involves forcing the mouse position). Would unity ever consider Screen.clampCursor so that we can maintain the consistent feel of a mouse cursor between game and OS? This would be very similar to Screen.lockCursor in terms of hitting escape, or switching application focus to “free” the cursor, and not allowing unity to “steal” focus, but would allow the mouse cursor to move freely within the confines of the unity screen space while unity has focus.

*The Facebook version of fruit ninja has an interesting way around this, but I think that a clamped mouse may work better.

[Edit] Something similar was requested for fullscreen, so that the mouse didn’t escape into other displays… in 2006? Lost on the TODO list? I wonder if it’s not as simple as it sounds across platforms?

Anyone? I’m also having issues imitating the cursor. Basically my custom cursor doesn’t exactly follow the system mouse; when quickly moving the mouse, the custom cursor that’s supposed to stick with the mouse moves slower than the system cursor. I tried changing the sensitivity until the custom mouse sticks with the system mouse in low speed, but as I cited when quickly moving the system mouse, the two cursors are out of sync ( the custom moves in this case slower).
I’m updating the custom cursor like so :

transform.position += new Vector2(Input.GetAxis("MouseX"), Input.GetAxis("MouseY"));