Okay, so I have created a pretty nice custom animator for ease of animating character models for a game I've been working on. You can check it out (so far) here.
HOTKEYS:
**Use "-" and "=" to add backward and forward onion-skin layers, respectively.
**Use "SHIFT -" and "SHIFT =" to remove the onion-skin layers.
**Use "." and "," to step forward and backward between frames, just like in Flash.


However, I am trying to add undo/redo actions, and, although I have figured something out that will work, I'm not exactly sure if there is a better way to go about doing this.


Obviously just saying "undo/redo functionality" is pretty vague and generalized, so here are some specifics:

I have only a few specific types of actions that I would ever have to undo/redo:
-changing the rotation of a segment
-moving the model's position (x,y)
-inserting a new frame (new frame will be the next frame forward from the current frame)
-removing the current frame
-swapping the current frame with the previous frame
-swapping the current frame with the next frame

What would be the most efficient way to work with this? Seeing as there are only a few possibilities, I would figure that it would be easiest to program how to deal with undoing/redoing each specific type of action. Am I right to think that? Or is there a better way to do it?