diff --git a/sphinx/themes/basic/static/doctools.js b/sphinx/themes/basic/static/doctools.js index 8cbf1b161a..27e5b5618a 100644 --- a/sphinx/themes/basic/static/doctools.js +++ b/sphinx/themes/basic/static/doctools.js @@ -294,20 +294,26 @@ var Documentation = { if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) { - switch (event.keyCode) { - case 37: // left + switch (event.key) { + case "ArrowLeft": var prevHref = $('link[rel="prev"]').prop('href'); if (prevHref) { window.location.href = prevHref; return false; } - break; - case 39: // right + case "ArrowRight": var nextHref = $('link[rel="next"]').prop('href'); if (nextHref) { window.location.href = nextHref; return false; } + case "/": + case "s": + $('input[name=q]').focus(); + return false; + case "c": + newurl = window.location.href.replace(new RegExp("\\?highlight=[^#]*"), ""); + window.location.href = newurl; break; } }