X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=6bf57ac091d1a9e9d61e8fc2a5b38fdd534a803f;hb=2392a87503272e7ae1dcaa6aa8628955dc5493d1;hp=c4c5bf33ff062999577131a655f09cb230ddd80a;hpb=c7f63aacef9cbcd5b46d6d7693d95d9584786106;p=xboard.git diff --git a/backend.c b/backend.c index c4c5bf3..6bf57ac 100644 --- a/backend.c +++ b/backend.c @@ -7388,7 +7388,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) x = BOARD_WIDTH - 1 - x; } - if(appData.monoMouse && gameMode == EditPosition && clickType == Press && boards[currentMove][y][x] == EmptySquare) { + if(appData.monoMouse && gameMode == EditPosition && fromX < 0 && clickType == Press && boards[currentMove][y][x] == EmptySquare) { static int dummy; RightClick(clickType, xPix, yPix, &dummy, &dummy); right = TRUE; @@ -7495,7 +7495,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) return; } } - +printf("to click %d,%d\n",x,y); /* fromX != -1 */ if (clickType == Press && gameMode != EditPosition) { ChessSquare fromP; @@ -7558,6 +7558,12 @@ LeftClick (ClickType clickType, int xPix, int yPix) // ignore clicks on holdings if(x < BOARD_LEFT || x >= BOARD_RGHT) return; } +printf("A type=%d\n",clickType); + + if(x == fromX && y == fromY && gameMode == EditPosition && SubtractTimeMarks(&lastClickTime, &prevClickTime) < 200) { + gatingPiece = boards[currentMove][fromY][fromX]; // prepare to copy rather than move + return; + } if (clickType == Release && x == fromX && y == fromY && killX < 0) { DragPieceEnd(xPix, yPix); dragging = 0; @@ -7591,7 +7597,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) } clearFlag = 0; - +printf("B\n"); if(gameMode != EditPosition && !appData.testLegality && !legal[y][x] && fromX >= BOARD_LEFT && fromX < BOARD_RGHT && (x != killX || y != killY) && !sweepSelecting) { if(dragging) DragPieceEnd(xPix, yPix), dragging = 0; @@ -7599,7 +7605,7 @@ LeftClick (ClickType clickType, int xPix, int yPix) DrawPosition(TRUE, NULL); return; // ignore to-click } - +printf("(%d,%d)-(%d,%d) %d %d\n",fromX,fromY,toX,toY,x,y); /* we now have a different from- and (possibly off-board) to-square */ /* Completed move */ if(!sweepSelecting) {