Fixed switching from keyboard bug