fix keyevent handling