Scroll Bars and the Keyboard

When a scroll bar has the keyboard focus, it generates notification messages for the following keys:

┌───────────────┬─────────────────────────────────────────────┐
│Keys           │Response                                     │
├───────────────┼─────────────────────────────────────────────┤
│UP             │SB_LINEUP or SB_LINELEFT                     │
├───────────────┼─────────────────────────────────────────────┤
│LEFT           │SB_LINEUP or SB_LINELEFT                     │
├───────────────┼─────────────────────────────────────────────┤
│DOWN           │SB_LINEDOWN or SB_LINERIGHT                  │
├───────────────┼─────────────────────────────────────────────┤
│RIGHT          │SB_LINEDOWN or SB_LINERIGHT                  │
├───────────────┼─────────────────────────────────────────────┤
│PGUP           │SB_PAGEUP or SB_PAGELEFT                     │
├───────────────┼─────────────────────────────────────────────┤
│PGDN           │SB_PAGEDOWN or SB_PAGERIGHT                  │
└───────────────┴─────────────────────────────────────────────┘

If an application uses scroll bars to scroll data but does not give the scroll bar the input focus, the window with the focus must process keyboard input. The window can generate scroll-bar notification messages or carry out the indicated scrolling. The following table shows the responses to keys that a window must process:

┌───────────────┬─────────────────────────────────────────────┐
│Key            │Response                                     │
├───────────────┼─────────────────────────────────────────────┤
│UP             │SB_LINEUP                                    │
├───────────────┼─────────────────────────────────────────────┤
│DOWN           │SB_LINEDOWN                                  │
├───────────────┼─────────────────────────────────────────────┤
│PGUP           │SB_PAGEUP                                    │
├───────────────┼─────────────────────────────────────────────┤
│PGDN           │SB_PAGEDOWN                                  │
├───────────────┼─────────────────────────────────────────────┤
│CTRL+HOME      │SB_SLIDERTRACK, with the slider set to the   │
│               │minimum position                             │
├───────────────┼─────────────────────────────────────────────┤
│CTRL+END       │SB_SLIDERTRACK, with the slider set to the   │
│               │maximum position                             │
├───────────────┼─────────────────────────────────────────────┤
│LEFT           │SB_LINELEFT                                  │
├───────────────┼─────────────────────────────────────────────┤
│RIGHT          │SB_LINERIGHT                                 │
├───────────────┼─────────────────────────────────────────────┤
│CTRL+PGUP      │SB_PAGELEFT                                  │
├───────────────┼─────────────────────────────────────────────┤
│CTRL+PGDN      │SB_PAGERIGHT                                 │
├───────────────┼─────────────────────────────────────────────┤
│HOME           │SB_SLIDERTRACK, with the slider set to the   │
│               │minimum position                             │
├───────────────┼─────────────────────────────────────────────┤
│END            │SB_SLIDERTRACK, with the slider set to the   │
│               │maximum position                             │
└───────────────┴─────────────────────────────────────────────┘

For vertical scroll bars that are part of list boxes, the following table shows the responses to keys:

┌───────────────┬─────────────────────────────────────────────┐
│Key            │Command                                      │
├───────────────┼─────────────────────────────────────────────┤
│CTRL+UP        │SB_SLIDERTRACK, with the slider set to the   │
│               │minimum position                             │
├───────────────┼─────────────────────────────────────────────┤
│CTRL+DOWN      │SB_SLIDERTRACK, with the slider set to the   │
│               │maximum position                             │
├───────────────┼─────────────────────────────────────────────┤
│F7             │SB_PAGEUP                                    │
├───────────────┼─────────────────────────────────────────────┤
│F8             │SB_PAGEDOWN                                  │
└───────────────┴─────────────────────────────────────────────┘


[Back: Scroll-Bar Notification Messages]
[Next: Using Scroll Bars]