Added support for key pressing.