Keyboard doesn't work after wake up from suspend

It’s quite interesting actually. When select the option “Lock the screen when computer is suspend” from Power management > Security, the keyboard works fine after wake up and i write my password to login. But, when i didnt choose that option, the keyboard doesnt work.

I use lightdm as default.