refactor TInputEvent