Fix refactored key press code.