From 0984533d7857a31638e2bcaa4eb085abd419aa3a Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 24 Mar 2010 18:00:08 +0100 Subject: [PATCH] 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. --- winboard/winboard.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) 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); -- 1.7.0.4