Erratic mouse movement while Photon is plugged in

There's this:

That one works for code (though it's not formatted as nicely as the first option).

And a more recent, and probably best method, is sharing the application from the Web IDE so we can import it directly, including any libraries you've used. That way, we don't have to guess.

As to the actual problem, like @Rftop mentioned, several threads already discuss the issue you've described. Have a look/search.