Added test for key press detection.