From: H.G. Muller Date: Wed, 24 Mar 2010 17:00:08 +0000 (+0100) Subject: Allow adjustment of clocks in any mode with shift+click X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=0984533d7857a31638e2bcaa4eb085abd419aa3a;p=xboard.git Allow adjustment of clocks in any mode with shift+click In practice changing to edit-game mode during a game was very cumbersome. In WinBoard shift+click is now offered as an alternative. Make sure a right-click in the clock area is not also counted for other purposes. --- diff --git a/winboard/winboard.c b/winboard/winboard.c index 5c2078f..195ecfc 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -3797,20 +3797,20 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (PtInRect((LPRECT) &whiteRect, pt)) { if (gameMode == EditPosition) { SetWhiteToPlayEvent(); + } else if (gameMode == EditGame || GetKeyState(VK_SHIFT) < 0) { + AdjustClock(flipClock, -1); } else if (gameMode == IcsPlayingBlack || gameMode == MachinePlaysWhite) { CallFlagEvent(); - } else if (gameMode == EditGame) { - AdjustClock(flipClock, -1); } } else if (PtInRect((LPRECT) &blackRect, pt)) { if (gameMode == EditPosition) { SetBlackToPlayEvent(); + } else if (gameMode == EditGame || GetKeyState(VK_SHIFT) < 0) { + AdjustClock(!flipClock, -1); } else if (gameMode == IcsPlayingWhite || gameMode == MachinePlaysBlack) { CallFlagEvent(); - } else if (gameMode == EditGame) { - AdjustClock(!flipClock, -1); } } dragInfo.start.x = dragInfo.start.y = -1; @@ -3890,10 +3890,11 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if(y == -2) { /* [HGM] right mouse button in clock area edit-game mode ups clock */ if (PtInRect((LPRECT) &whiteRect, pt)) { - if (gameMode == EditGame) AdjustClock(flipClock, 1); + if (gameMode == EditGame || GetKeyState(VK_SHIFT) < 0) AdjustClock(flipClock, 1); } else if (PtInRect((LPRECT) &blackRect, pt)) { - if (gameMode == EditGame) AdjustClock(!flipClock, 1); + if (gameMode == EditGame || GetKeyState(VK_SHIFT) < 0) AdjustClock(!flipClock, 1); } + break; } DrawPosition(TRUE, NULL);