Added keyboard input helper method