Update keypress detection.