Clean up case switching in handleKeyPress()