Page 1 of 1
Restricting X-Axis mouse movement
Posted: March 6th, 2013, 1:16 pm
by wishfulscientist
Hi all,
Is there a way to restrict (eliminate) a player's mouse x-axis in game or through .cfg file editing? Or is it simpler to do it through programs in Windows?
Thanks much!
Re: Restricting X-Axis mouse movement
Posted: March 7th, 2013, 12:38 pm
by wishfulscientist
I tried using an authotkey script that works wonderfully in windows explorer:
YOUR FAVORITE KEY 1::
Confine := !Confine
ClipCursor( Confine, A_ScreenWidth//2, 0, A_ScreenWidth//2, A_ScreenHeight )
Return
YOUR FAVORITE KEY 2::
Confine := !Confine
ClipCursor( Confine, 0, A_ScreenHeight//2, A_ScreenWidth, A_ScreenHeight//2 )
Return
ClipCursor( Confine=True, x1=0 , y1=0, x2=1, y2=1 ) {
VarSetCapacity(R,16,0), NumPut(x1,&R+0),NumPut(y1,&R+4),NumPut(x2,&R+8),NumPut(y2,&R+12)
Return Confine ? DllCall( "ClipCursor", UInt,&R ) : DllCall( "ClipCursor" )
}
However 'yfk1' locks the cursor up and repeatedly (quickly) switching it on and off seems to make the player spin around the x-axis, whereas it should lock the X axis in place.
'yfk2' shoots the cursor and view upward along the y axis. So they do consistent things, I guess. Something is getting messed up along the way.
Any takers?
Re: Restricting X-Axis mouse movement
Posted: March 8th, 2013, 12:00 pm
by wishfulscientist
Figured it out using Autohotkey as before, modifying the previous script. The symptoms of the error were odd, but a huge performance hit while the player was spinning suggested that the computer could not do a particular function, but was trying. I manually specified 2 pixels in the middle of the screen and found that the cursor won't move in explorer (good news! it's being confined within them) and this method works in game. So the computer just needed a specified, feasible boundary.
Hope that made sense.