Use S to change mode. Use W to reset. Use space to enter regular polygon mode. Use A and D to change the way W and space affect the shape.
Most of the work was done by sticku in the original version, but I added rotation, zooming, resetting and five new modes.