Graphics editor - square/circle lazarus / 39-Graphics ---------------------------------------------------------------------- Tallmios · 2015-10-11 20:28 I've created a graphics editor using Pascal through Turbo Delphi.  Drawing a rectangle/ellipse works like this: https://i.gyazo.com/aea5ea17c3fadcaf106c9f53acae49ff.gif  (the cursor is desynchronised in the gif, but works correctly in the program).  How would I go about drawing a square/circle with the right mouse button, similarly to how Microsoft Paint allows you right angles/circles/squares when you're holding shift? ---------------------------------------------------------------------- Ñuño_Martínez · 2015-10-12 12:13 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: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   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, ...). ---------------------------------------------------------------------- Tallmios · 2015-10-12 20:26 Thank you. I'll try your code out. In my program it's going to be a function of RMB and I've already sorted that out.