X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fjaws.c;h=56c7411cba4659615c96de136fdf0b44a074cae4;hb=e7419db9b1c542d1ca0b825cdfc0032a4ba39188;hp=19ee0659de58f6fab86cdd988007741fb2ee45f9;hpb=5cd55bddca592918f38deff675d05b650a71412e;p=xboard.git diff --git a/winboard/jaws.c b/winboard/jaws.c index 19ee065..56c7411 100644 --- a/winboard/jaws.c +++ b/winboard/jaws.c @@ -282,6 +282,7 @@ InitJAWS() int beeps[] = { 1, 0, 0, 0, 0 }; int beepCodes[] = { 0, MB_OK, MB_ICONERROR, MB_ICONQUESTION, MB_ICONEXCLAMATION, MB_ICONASTERISK }; +static int dropX = -1, dropY = -1; VOID KeyboardEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -290,6 +291,10 @@ KeyboardEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) char *piece, *xchar, *ynum ; int n, beepType = 1; // empty beep + if(fromX == -1 || fromY == -1) { // if we just dropped piece, stay at that square + fromX = dropX; fromY = dropY; + dropX = dropY = -1; // but only once + } if(fromX == -1 || fromY == -1) { fromX = BOARD_LEFT; fromY = 0; } @@ -345,7 +350,7 @@ KeyboardEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) ynum = SquareToNum(fromY); if(currentPiece != EmptySquare) { // SayString(piece[0] == 'W' ? "white" : "black", TRUE); - sprintf(buf, "%s %s %s", piece, xchar, ynum); + sprintf(buf, "%s %s %s", xchar, ynum, piece); } else sprintf(buf, "%s %s", xchar, ynum); SayString(buf, TRUE); } @@ -947,7 +952,7 @@ SayMachineMove(int evenIfDuplicate) break; } } - if(c != lastMover) return; // line is thinking output of future move, ignore. + if(c != lastMover && !evenIfDuplicate) return; // line is thinking output of future move, ignore. if(2*moveNr - (dotCount < 2) == previousMove) return; // do not repeat same move; likely ponder output sprintf(buf, "score %s %d at %d ply", @@ -1071,11 +1076,11 @@ SayClockTime() suppressClocks = 0; // back on after two requests in rapid succession sprintf(buf1, "%s", TimeString(whiteTimeRemaining)); str1 = buf1; - SayString("White's remaining time is", FALSE); + SayString("White clock", FALSE); SayString(str1, FALSE); sprintf(buf2, "%s", TimeString(blackTimeRemaining)); str2 = buf2; - SayString("Black's remaining time is", FALSE); + SayString("Black clock", FALSE); SayString(str2, FALSE); lastWhiteTime = whiteTimeRemaining; lastBlackTime = blackTimeRemaining; @@ -1194,6 +1199,7 @@ NiceTime(int x) if ((char)wParam == 022 && gameMode == EditPosition) { /* . Pop up piece menu */\ POINT pt; int x, y;\ SquareToPos(fromY, fromX, &x, &y);\ + dropX = fromX; dropY = fromY;\ pt.x = x; pt.y = y;\ if(gameInfo.variant != VariantShogi)\ MenuPopup(hwnd, pt, LoadMenu(hInst, "PieceMenu"), -1);\