I have the same issue sometimes, it is usually solved by switching out of the game and back in again, pressing Alt+Enter.
Also, if the camera view is locked, check if you have a joystick or controller connected to the computer, and if you have, try to check the option to disable the controllers. I had this issue that a connected joystick would constantly move my view around.