I use my MacBook Air (OS X 10.7.4) with the Apple USB keyboard with numpad and the USB mouse (connected to the keyboard). Perhaps unrelated, I also use an external monitor.
If I am lucky, the keyboard and mouse work fine. I can go in and out of sleep mode and the keyboard and mouse keep working just fine.
But when I have been away with only my Mac and I return to my desk to reconnect the keyboard, the keyboard and mouse do not respond and oftentimes the screen freezes (so that I cannot even use the internal keyboard). Sometimes only for about 5 seconds. But the keyboard and mouse does not start to work. I have tried to go in and out of standby mode, restart and shut down with the keyboard connected. But it only rarely helps. Right when I write this, I had the non-working external keyboard connected. And after about 3-5 minutes it started to work normally "by itself".
I have searched the internet but have not been able to find others with the same problem or a solution to the issue for that matter. I have reported the problem to www.apple.com/feedback but they do not offer much help in return.
Perhaps someone else experiences this issue or even has a solution?