Keyboard problem

i am using onscreen keybd 2 type this msg. keyboard works when i wake computer and type in password. i had been using onscreen as batteries in keybd were flat. have i not closed onscreen kyboard correctly? Ijust clicked the x top left. thanks if you can help.