Fix Undo on Keyboard Movement