so that we could get the correct keyCode after the state, such as "capitalization", is changed by the previous sendKey action.