mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 13:27:49 +08:00
Ctrl/Cmd+Shift+P as alternate way to open command line (#1736)
* Renamed command line setting timer-progress bar * Added ctrl/cmd + shift + p as alternate keyboard shortcut to open command line * Update commandline.js * Fixed typo * fixed error if key is nulish Co-authored-by: Jack <bartnikjack@gmail.com>
This commit is contained in:
parent
72ef29b74c
commit
250590b777
1 changed files with 9 additions and 2 deletions
|
@ -330,8 +330,15 @@ $("#commandLine input").keyup((e) => {
|
|||
|
||||
$(document).ready((e) => {
|
||||
$(document).keydown((event) => {
|
||||
//escape
|
||||
if (event.keyCode == 27 || (event.keyCode == 9 && Config.swapEscAndTab)) {
|
||||
// opens command line if escape, ctrl/cmd + shift + p, or tab is pressed if the setting swapEscAndTab is enabled
|
||||
if (
|
||||
event.keyCode == 27 ||
|
||||
(event.key &&
|
||||
event.key.toLowerCase() == "p" &&
|
||||
(event.metaKey || event.ctrlKey) &&
|
||||
event.shiftKey) ||
|
||||
(event.keyCode == 9 && Config.swapEscAndTab)
|
||||
) {
|
||||
event.preventDefault();
|
||||
if (!$("#leaderboardsWrapper").hasClass("hidden")) {
|
||||
//maybe add more condition for closing other dialogs in the future as well
|
||||
|
|
Loading…
Reference in a new issue