From 87c8382daff3333cbb54bdfa11c5e3ef20836e45 Mon Sep 17 00:00:00 2001 From: Daniel Vainsencher Date: Sun, 30 May 2021 23:02:57 -0700 Subject: [PATCH] Support overriding search key --- src/theme/searcher/searcher.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/theme/searcher/searcher.js b/src/theme/searcher/searcher.js index d2b0aeed..c0e1c798 100644 --- a/src/theme/searcher/searcher.js +++ b/src/theme/searcher/searcher.js @@ -25,6 +25,7 @@ window.search = window.search || {}; searchresults_header = document.getElementById('searchresults-header'), searchicon = document.getElementById('search-toggle'), content = document.getElementById('content'), + search_key_override = document.getElementById('search-key-override-keycode'), searchindex = null, doc_urls = [], @@ -48,7 +49,11 @@ window.search = window.search || {}; URL_MARK_PARAM = 'highlight', teaser_count = 0, - SEARCH_HOTKEY_KEYCODE = 83, + if (search_key_override != null) { + SEARCH_HOTKEY_KEYCODE = search_key_override, + } else { + SEARCH_HOTKEY_KEYCODE = 83, + } ESCAPE_KEYCODE = 27, DOWN_KEYCODE = 40, UP_KEYCODE = 38,