Uh oh!
There was an error while loading. Please reload this page.
Enable keyboard navigation for Python docs - #148751
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
hugovk
commented
Apr 19, 2026
Copying my comment from python/devguide#1784 (comment): Nice little shortcut, but I'm concerned this will interfere with keyboard handling for people using assistive tech such as screen readers. https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/ includes:
https://webaim.org/techniques/keyboard/ has examples where |
abitrolly
commented
Apr 19, 2026
@hugovk keyboard shortcuts are disabled for these HTML elements - "TEXTAREA", "INPUT", "SELECT", "BUTTON" (https://github.com/sphinx-doc/sphinx/blob/cc7c6f435ad37bb12264f8118c8461b230e6830c/sphinx/themes/basic/static/doctools.js#L6-L11) Is that enough for Python docs? The ARIA guidelines are too generic - they say "Consider, for example, a screen reader user operating a tree.", but as far as I can tell there are no expandable trees in Python docs. |
hugovk
commented
Apr 19, 2026
My understanding is that screen readers use left and right to navigate character-by-character:
https://tink.uk/understanding-screen-reader-interaction-modes/
Or for navigating table cells: https://dequeuniversity.com/screenreaders/nvda-keyboard-shortcuts So any other interception of arrow keys would be a problem. |
abitrolly
commented
Apr 20, 2026
If the screen reader indeed intercepts the left/right keys to provide its own functions, then the problem doesn't exist. We need a screen reader user to test that https://cpython-previews--148751.org.readthedocs.build/en/148751/tutorial/index.html page doesn't trigger navigation to next when right arrow key is pressed while screen reader is active. The link goes to the tutorial page, because front page doesn't have |
This PR is stale because it has been open for 90 days with no activity. |
You can test how it works before this change by setting DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS = true in JavaScript console and press Left on the keyboard.
abitrolly
commented
Jul 27, 2026
Documentation build overview
293 files changed · |
StanFromIreland
commented
Jul 27, 2026
I'm closing this for now, as I don't see support from any core devs for this change. Additionally, I'm not sure I see user demand either. You opened similar PRs across many repositories in a short period, so out of curiosity, do you actually use this feature? |
hugovk
commented
Jul 27, 2026
Joining the dots, I replied at python/docs-community#199 (comment). |
You can test how it works before this change by opening JavaScript console with F12 and setting
then make sure the focus is in the main are and press Left on the keyboard.
The option is documented here https://www.sphinx-doc.org/en/master/usage/theming.html#:~:text=navigation%5Fwith%5Fkeys
📚 Documentation preview 📚: https://cpython-previews--148751.org.readthedocs.build/