File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1241,6 +1241,7 @@ fn settings(root_path: &str, suffix: &str) -> String {
12411241 ( "go-to-only-result" , "Directly go to item in search if there is only one result" ,
12421242 false ) ,
12431243 ( "line-numbers" , "Show line numbers on code examples" , false ) ,
1244+ ( "disable-shortcuts" , "Disable keyboard shortcuts" , false ) ,
12441245 ] ;
12451246 format ! (
12461247"<h1 class='fqn'>\
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ function getSearchElement() {
7979 "derive" ,
8080 "traitalias" ] ;
8181
82+ var disableShortcuts = getCurrentValue ( "rustdoc-disable-shortcuts" ) !== "true" ;
8283 var search_input = getSearchInput ( ) ;
8384
8485 // On the search screen, so you remain on the last tab you opened.
@@ -294,7 +295,7 @@ function getSearchElement() {
294295
295296 function handleShortcut ( ev ) {
296297 // Don't interfere with browser shortcuts
297- if ( ev . ctrlKey || ev . altKey || ev . metaKey ) {
298+ if ( ev . ctrlKey || ev . altKey || ev . metaKey || disableShortcuts === true ) {
298299 return ;
299300 }
300301
You can’t perform that action at this time.
0 commit comments