New class created for key press control