make switch statement in keyPressed()