It really was a cat. His name is Stubby, and he doesn't understand our human concepts of "boundaries" or "get off the keyboard".
Sorry about that.
This also happens a lot. If you ever find your desktop is suddenly sideways or upside down, you can easily fix it (on Windows) by pressing Ctrl+Alt+Up Arrow.