With Firefox Aurora, Mountain Lion hung - but the mouse still worked I've just had my first Mountain Lion lockup. The screen was entirely frozen in place (I have seconds displayed on my clock in iStat Menu and even that wasn't moving) BUT the mouse still worked. I could move that around. Nothing else did anything.

I noticed that the keyboard backlight also didn't come on if I typed anything in.

I have SSH access to the machine and that also still worked so it looks like just the GUI was the problem.

Anyone else had this, and have a fix if it happens again?

Its a MBP Retina, 2.6/16/512, with the SMC update from yesterday applied. No optical bay. Graphics: Intel HD4000 integrated, and a discrete Nvidia GT650M. 

At the time of the hang it was on mains power, undocked, no external devices plugged in. The NVidia GT650M was in use (it always is, some of my running apps force it on for some reason, postbox for example).

I had Firefox Aurora (their bleeding edge version) active and it was actually in the middle of rendering an Ebay login page as well.
Suspect an issue affecting the WindowServer process (brief edition for power users)

The symptoms you describe are familiar but not commonplace and in my case, not frequent. 

Diagnosis – at the time of the problem, if it recurs

Remotely, 

sudo sysdiagnose


After you regain local control, you can analyse the end result. 

Remotely, 

top -o state


Processes that are stuck should be at or near the top. 

Is WindowServer stuck for any length of time?

Workaround

If WindowServer is stuck, you might kill remotely – 

sudo killall WindowServer


– but this will cause a local log out, so be prepared to lose unsaved changes. 



This relatively short answer is tuned to the opening poster's confidence with remote ssh and bleeding edge stuff. 

For a more detailed answer, accepted under a similar question where the cause of a problem may be different: Suspect an issue affecting the WindowServer process (long edition)