UI keyboard and mouse handling