Difference between IN_MOVELEFT & IN_LEFT

So the title pretty much said it all.
I would like to know what is the difference between;

[lua]player:KeyDown( IN_LEFT )[/lua]

[lua]player:KeyDown( IN_MOVELEFT )[/lua]

Anybody know?

Thank you.

IN_LEFT could be the “left arrow” key.

You should search :v:


is LEFT, whereas MOVELEFT is strafe left (default ‘a’).

Ok, and would IN_MOVELEFT work with the mouse? since turning is mostly executed with the mouse. If not, How could I find which way the mouse is being moved? I know there is gui.MouseX() but thats client-side.

MOVELEFT = the +left concommand

LEFT is mouse moving left, I cant remember the console command for it but its where you can turn the direction you are facing…as in mouse


o.o Left in all caps looks weird.

Alright, so, IN_MOVELEFT is moving to the left using the A, good, and LEFT is when we rotate to the left with mouse/and the turn button if it is enabled. Sweet.

Thanks guys.

IN_LEFT does NOT work with the mouse. Ever. It is solely assigned to the key on your keyboard that will change your yaw - making you look left or right.

Ahh, damn, then do you know how I could get which way the mouse was moved?

Yeah, I’m not really sure its possible to detect mouse gestures from server. Also, What are you actually trying to use this for?

And I think it might possible to check if X is added or subtracted while using http://wiki.garrysmod.com/?title=Player.GetEyeTraceNoCursor

Altho, I’m not 100% sure

What I was basically trying to make, is a strafing script.
Mimicking it from CSS. I don’t know if some of you play it but.

If you are IN_JUMP and you move left while moving your mouse to the left, your velocity will increase forward, and leftward. Same base for the right side. This way you can pick up speed by straffing.

Get it?

Use the event CreateMove or get the current command using pl:GetCurrentCommand(). The latter will work on the server.
Then you can use cmd:GetMouseX() and cmd:GetMouseY(). These values will be 0 if their mouse isn’t moving. If they move the mouse left X will be negative. If they move the mouse right X will be positive. The same applies to Y.

Thanks this makes it a whole lot easier, but I got a question.

Wouldn’t it be better to use the event SetupMove ?