calculator: modify event handler.