Added keyboard input functionality