When drawing, just check if Shift is pressed, if so then check which one is smaller (width or height) and use it as both values. Something like this:
BEGIN
Width := MouseX - OriginX; Height := MouseY - OriginY;
IF ShiftPressed THEN
BEGIN
IF Width < Height THEN
DrawEllipse (OrigX, OrigY, Width, Width)
ELSE
DrawEllipse (OrigX, OrigY, Height, Height)
END
ELSE
DrawEllipse (OrigX, OrigY, Width, Height)
END;
If you're asking how to know if Shift is pressed, it is different in each framework/library you're using (i.e. SDL, FCL, Allegro, ...).