Hello and thanks for the reply.
Well yes I know that it is not really a random angle, but it feels like it is to a player. I don't understand the logic behind it perfectly but it will set the angle depending on where the cursor is at the X axis when the right button is clicked and that causes the “jump”, maybe the logic goes just like you said.
After I posted that question I started playing with ui/hud and already realized that if I'm using layout angle for rotation, it will rotate the hud around as well. So I changed rotation to only take account layers 0 and 1, and now hud will stay where it should be.
Player is supposed to strafe when right button is down and A or D is pressed, and rotate when right button is not down. So now strafing is quick and easy to use and you don't need to set different keys for it. This maybe explains the “glitchy” feeling.
Currently I don't know how to implement those add and subtract commands with mouse correctly and that is why I was using layer/layout rotation. But if that what you suggested doing with the mouse lock is possible it might work, I'll try it out.