Don't handle keys while moving or rotating with the mouse

The undo stack gets confused when that happens.