Macbook - Macbook not responsive after returning from idle

I have a 19inch monitor, a wireless mouse, and an Apple keyboard hooked up to a Macbook so that when I close the Macbook it does not go to sleep. But I have realized that when I move my mouse to wake up the Macbook I can move the cursor around, but when I try to click anything nothing would respond. I tried to do "Apple+Tab" to switch between applications but that's all I could really do; I could switch and focus on different applications but I can't click on a certain application window to have it be on top. It takes a few minutes before I could click anything....does anyone know what problem I am experiencing and if there is a way to fix this problem?