How would any of you recommend implementing a "record" feature in a game, so a player can replay his game?

I'm assuming the best way would be to record his/her keystrokes and read from a record of them rather than the keyboard when replaying. Everything else in the game would be the same. Is that the right approach?