Jim - 2013-06-20

To make things a little easier I looked at what code would need to change for this. It's pretty straightforward, although I couldn't test it since the project doesn't compile in my computer's version of Visual Studio.

The quick summary is: check whether the shift key is down by checking whether GetKeyState(VK_SHIFT) is non-zero. It is important to use GetKeyState and NOT GetAsyncKeyState because if CPU load is high then the key state may have changed (i.e. the shift key released) since the space key message was queued. Technically the return value of GetKeyState is more complicated than a boolean, but this isn't important for keys that don't toggle (unlike Caps Lock, Scroll Lock, Num Lock).

In more practical terms: In DjVuView.cpp, in the switch statement in CDjVuView::OnKeyDown, replace the current code for the VK_NEXT, VK_SPACE, VK_PRIOR and VK_BACK cases (currently in two groups) with:

case VK_NEXT:
case VK_SPACE:
case VK_PRIOR:
case VK_BACK:
    if ((nChar == VK_NEXT) || ((nChar == VK_SPACE) && !GetKeyState(VK_SHIFT)))
        szScroll.cy = m_szPage.cy;
        bNextPage = true;
        bAlignTop = true;
        szScroll.cy = -m_szPage.cy;
        bPrevPage = true;
        bAlignBottom = true;
Last edit: Jim 2013-06-20