Restricting X-Axis mouse movement

Having issues not related to a specific Sandbox game mode? Get help here!
Please also read the when posting support requests.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
wishfulscientist
Member
Member
Posts: 16
Joined: February 26th, 2013, 3:40 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Restricting X-Axis mouse movement

Postby wishfulscientist » March 6th, 2013, 1:16 pm

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!

wishfulscientist
Member
Member
Posts: 16
Joined: February 26th, 2013, 3:40 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Restricting X-Axis mouse movement

Postby wishfulscientist » March 7th, 2013, 12:38 pm

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?

wishfulscientist
Member
Member
Posts: 16
Joined: February 26th, 2013, 3:40 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Restricting X-Axis mouse movement

Postby wishfulscientist » March 8th, 2013, 12:00 pm

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.


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “Sandbox General Support”

Who is online

Users browsing this forum: No registered users and 5 guests