Mouse not being reset

Ok so i recently upgraded from Windows XP 32bit, to Windows 7 64 bit. I plugged my old HDD in (which has steam and my games, including GMod)

I am having a rather strange problem. If you don’t know anything about how games work ill try and explain quickly. (if anyone can do a better job of explaining how the mouse makes your camera move in a game please post :P)

So how dose the mouse work in a game? Well, when you move your mouse 10 pixels to the left, the game goes “oh look, he moved his mouse 10 pixels to the left, lets move his view accordingly”, then RESETS the mouse to the center of the screen. This happens every frame.

Now if the game forgot to Reset the mouse to the center of the screen, it would be going “Oh look, he moved his mouse, lets move his view” EVERY frame. The only way to get it to stop moving would be to manually move the mouse back to the center.

This is whats happening to me… And its rather annoying.

Yes i know this is the wrong place to post, BUT i thought it might be possible to manually reset the mouse every frame with Lua. That and the fact that the people here know a fuckload more than the people in most of the other threads :slight_smile:

I had a few trys at it myself:
// This didn’t work at all
hook.Add( “Think”, “1234567890” ,function() gui.SetMousePos( ScrW() / 2, ScrH() / 2 ) end )
// This SHOULD have worked
hook.Add (“Think”, “1234567890”, function() gui.EnableScreenClicker( true )
gui.SetMousePos( ScrW() / 2, ScrH() / 2 )
gui.EnableScreenClicker( false )
end )

Im totally lost for ideas, and rather tired. Help would be much appareciated

Try this.

[lua]function GAMEMODE:CalcView(pl , org , ang , fov)
local view = {}
view.origin = org
view.angles = pl:GetAngles()
view.fov = fov
return view

Your angles will now remain what they should be, regardless of if the mouse has moved or not.

Uhhh… Trippy… But not working.