Thanks everyone for your help! I'm a mac newbie and thought I was turning off the bluetooth file transfer and was in a panic. Simply rebooting didn't work, but when I unplugged my usb backup drive and usb printer, unpplugged the computer from the wall and then plugged it back in, it detected both the trackpad and keyboard.
This might not be the same issue, but:
I have a mid 2010 27" iMac that occasionally loses all BlueTooth connections. I just had a chance to test this.
I found my iMac just starting to run the screensaver. It was looking for pictures, then found them and began displaying them. None of my three Apple BlueTooth devices (keyboard, Magic Mouse and Magic Trackpad) worked. So far, this is just like all the other times this has happened.
I recently got a wired Apple trackball mouse, and plugged that in. It woke the iMac, and gave me a cursor. I could use the menu bar BlueTooth icon to see that BlueTooth was off. I could not turn it on with the menubar icon.
I tried to turn BlueTooth on with BlueTooth preferences and that didn't work either.
I could log out, but couldn't log back in because logging out did not bring the BlueTooth keyboard back on.
A soft restart worked, bring BlueTooth back up as usual.
07 24 12 9:03:04.000 PM kernel: E:[AppleUSBBluetoothHCIController][StartBulkPipeRead] ClearPipeStall failed with error 0xe000404f
This is an error that I've seen in other instances where BlueTooth has failed. I've also seen this reported on the web.
As this seems like a software problem, I'm holding out hope for a fix in Mountain Lion.
I had the same problem and wanted to add one more solution to the list. I had a laptop on the same network which I'd used to screen share with my iMac. When the Bluetooth was turned off, I was able to use the laptop to restart the computer. So, on the off chance you have another computer on your network, you may be able to control the mouse remotely.