Added key press functionality.