Recently I'm using my MacBook Air mostly in clamshell mode, with an Wireless Keyboard and an Magic Trackpad paired. Sometimes, weeks pass by without even opening the lid: connecting it at the office, putting to sleep, connecting it at home etc.
From time to time, the bluetooth keyboard does not connect back on wake automatically, as the bluetooth trackpad does: I have to open the lid, type in my password, then pair the keyboard to use it.
What is the problem and how can it be fixed?