check if a key event is undo or redo