My keyboard wont connect to my imac and I cant do anything because its on sleep mode

So my imac is currently on sleep mode in which I need to type my password in order to "unlock/unsleep?" It. But my keyboard is not connecting to my imac. Ive already change the batteries with new ones and even try to connect my keyboard to my ipad( works perfectly fine).. what should I do?
Asked Apr 25, 2017
Edited Apr 25, 2017

TIP: If it's not your answer to this question, please click "Leave a Comment" button under the question to communicate with the question owner.