This issue is usually caused by a gamepad, joystick or other peripheral causing undesired input during gameplay.
The best workaround is to simply unplug any unused controllers or USB devices from your computer and then restart your game. If it persists even after restarting the game, you can try restarting your computer with the peripheral still unplugged.