Added keyboard handling