This question already has an answer here:
Twice now I have left my home laptop active and logged in on my desk to return and find the mouse moving around the screen, the first time browsing through Xbox smartglass and the second time in the act of closing photoshop. I haven't waited around to see what it will do before force shutting the thing down. No damage was done the first time and I have yet to check from the second time. Whoever is doing it doesn't appear on my wifi network. Programs I had open when my PC was compromised both times were XAMPP, chrome, and text editors, (running Windows 10). It's quite unpleasant knowing my PC can be hacked at any moment I'm not using it and I wonder if there's anything I can do to find the person behind it or prevent these attacks in the future?