{"id":42983,"date":"2003-08-05T08:32:00","date_gmt":"2003-08-05T08:32:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2003\/08\/05\/keyboard-accessibility-for-scrollbars\/"},"modified":"2003-08-05T08:32:00","modified_gmt":"2003-08-05T08:32:00","slug":"keyboard-accessibility-for-scrollbars","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20030805-00\/?p=42983","title":{"rendered":"Keyboard accessibility for scrollbars"},"content":{"rendered":"<p>\n        Note that so far, the scrollbar is accessible only with the mouse. Our next step is\n        to add keyboard access to the scrollbar. Fortunately, this is not all that difficult.\n        We merely map some keystrokes to equivalent scrollbar actions.\n    <\/p>\n<pre>void OnKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags)\n{\n    if (fDown) {\n        switch (vk) {\n        case VK_UP:         ScrollDelta(hwnd, -cRepeat); break;\n        case VK_DOWN:       ScrollDelta(hwnd, +cRepeat); break;\n        case VK_PRIOR:      ScrollDelta(hwnd, -cRepeat*g_cyPage); break;\n        case VK_NEXT:       ScrollDelta(hwnd, +cRepeat*g_cyPage); break;\n        case VK_HOME:       ScrollTo(hwnd, 0); break;\n        case VK_END:        ScrollTo(hwnd, MAXLONG); break;\n        }\n    }\n}\n    \/* Add to WndProc *\/\n    HANDLE_MSG(hwnd, WM_KEYDOWN, OnKey);\n<\/pre>\n<p>\nNote that this doesn&#8217;t make our sample program fully accessible;\nthis just makes the scrollbars accessible.  Full accessibility\nwill be covered in a (much) later blog entry.  Right now, I&#8217;m just\nfocusing on scrollbars.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Note that so far, the scrollbar is accessible only with the mouse. Our next step is to add keyboard access to the scrollbar. Fortunately, this is not all that difficult. We merely map some keystrokes to equivalent scrollbar actions. void OnKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags) { if (fDown) { switch [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-42983","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Note that so far, the scrollbar is accessible only with the mouse. Our next step is to add keyboard access to the scrollbar. Fortunately, this is not all that difficult. We merely map some keystrokes to equivalent scrollbar actions. void OnKey(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags) { if (fDown) { switch [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/42983","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=42983"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/42983\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=42983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=42983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=42983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}