* Massachusetts.\r
*\r
* Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,\r
- * 2007, 2008, 2009 Free Software Foundation, Inc.\r
+ * 2007, 2008, 2009, 2010 Free Software Foundation, Inc.\r
*\r
* XBoard borrows its colors and the bitmaps.xchess bitmap set from XChess,\r
* which was written and is copyrighted by Wayne Christopher.\r
\r
int beeps[] = { 1, 0, 0, 0, 0 };\r
int beepCodes[] = { 0, MB_OK, MB_ICONERROR, MB_ICONQUESTION, MB_ICONEXCLAMATION, MB_ICONASTERISK };\r
+static int dropX = -1, dropY = -1;\r
\r
VOID\r
KeyboardEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r
char *piece, *xchar, *ynum ;\r
int n, beepType = 1; // empty beep\r
\r
+ if(fromX == -1 || fromY == -1) { // if we just dropped piece, stay at that square\r
+ fromX = dropX; fromY = dropY;\r
+ dropX = dropY = -1; // but only once\r
+ }\r
if(fromX == -1 || fromY == -1) {\r
fromX = BOARD_LEFT; fromY = 0;\r
}\r
ynum = SquareToNum(fromY);\r
if(currentPiece != EmptySquare) {\r
// SayString(piece[0] == 'W' ? "white" : "black", TRUE);\r
- sprintf(buf, "%s %s %s", piece, xchar, ynum);\r
+ sprintf(buf, "%s %s %s", xchar, ynum, piece);\r
} else sprintf(buf, "%s %s", xchar, ynum);\r
SayString(buf, TRUE);\r
}\r
break;\r
}\r
}\r
- if(c != lastMover) return; // line is thinking output of future move, ignore.\r
+ if(c != lastMover && !evenIfDuplicate) return; // line is thinking output of future move, ignore.\r
if(2*moveNr - (dotCount < 2) == previousMove)\r
return; // do not repeat same move; likely ponder output\r
sprintf(buf, "score %s %d at %d ply", \r
suppressClocks = 0; // back on after two requests in rapid succession\r
sprintf(buf1, "%s", TimeString(whiteTimeRemaining));\r
str1 = buf1;\r
- SayString("White's remaining time is", FALSE);\r
+ SayString("White clock", FALSE);\r
SayString(str1, FALSE);\r
sprintf(buf2, "%s", TimeString(blackTimeRemaining));\r
str2 = buf2;\r
- SayString("Black's remaining time is", FALSE);\r
+ SayString("Black clock", FALSE);\r
SayString(str2, FALSE);\r
lastWhiteTime = whiteTimeRemaining;\r
lastBlackTime = blackTimeRemaining;\r
if ((char)wParam == 022 && gameMode == EditPosition) { /* <Ctl R>. Pop up piece menu */\\r
POINT pt; int x, y;\\r
SquareToPos(fromY, fromX, &x, &y);\\r
+ dropX = fromX; dropY = fromY;\\r
pt.x = x; pt.y = y;\\r
if(gameInfo.variant != VariantShogi)\\r
MenuPopup(hwnd, pt, LoadMenu(hInst, "PieceMenu"), -1);\\r