Need more information. How many inputs do you have, When exactly does it happen and is it only in Space Engine. There a few things that come to mind that could cause this, Malware, a sticky key(Not the windows option but an actual sticky key), an alternate input or an option in SE.
Most likely you ae using spacecraft mode, which is activated by pressing "2". To return to normal mode, press "1". Although it is possible to stop camera rotation in this mode by pressing "X" or "keypad_5".
Thank you for the suggestions, I'm sorry If I posted in the wrong place (I read the rule sections) It wasn't in spacecraft mode, but I think I've found the source of the problem now... I think! (need to test)
Had Keyboard and a Joystick plugged in, might be something to do with the stick hat.