File tree 2 files changed +3
-1
lines changed
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 {
1241
1241
( "go-to-only-result" , "Directly go to item in search if there is only one result" ,
1242
1242
false ) ,
1243
1243
( "line-numbers" , "Show line numbers on code examples" , false ) ,
1244
+ ( "disable-shortcuts" , "Disable keyboard shortcuts" , false ) ,
1244
1245
] ;
1245
1246
format ! (
1246
1247
"<h1 class='fqn'>\
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ function getSearchElement() {
79
79
"derive" ,
80
80
"traitalias" ] ;
81
81
82
+ var disableShortcuts = getCurrentValue ( "rustdoc-disable-shortcuts" ) !== "true" ;
82
83
var search_input = getSearchInput ( ) ;
83
84
84
85
// On the search screen, so you remain on the last tab you opened.
@@ -294,7 +295,7 @@ function getSearchElement() {
294
295
295
296
function handleShortcut ( ev ) {
296
297
// Don't interfere with browser shortcuts
297
- if ( ev . ctrlKey || ev . altKey || ev . metaKey ) {
298
+ if ( ev . ctrlKey || ev . altKey || ev . metaKey || disableShortcuts === true ) {
298
299
return ;
299
300
}
300
301
You can’t perform that action at this time.
0 commit comments