mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-07 19:38:09 +08:00
Change displayed modifier key based on platform (#3553) cubedhuang
* change modifier key based on platform * use navigator.userAgent instead of platform
This commit is contained in:
parent
9396b1b3f8
commit
fc7fdb8d98
1 changed files with 9 additions and 5 deletions
|
|
@ -9,28 +9,32 @@ import * as TestUI from "./test/test-ui";
|
|||
import { get as getActivePage } from "./states/active-page";
|
||||
|
||||
export function updateKeytips(): void {
|
||||
const modifierKey = window.navigator.userAgent.toLowerCase().includes("mac")
|
||||
? "cmd"
|
||||
: "ctrl";
|
||||
|
||||
if (Config.quickRestart === "esc") {
|
||||
$(".pageSettings .tip").html(`
|
||||
tip: You can also change all these settings quickly using the
|
||||
command line (<key>ctrl/cmd</key>+<key>shift</key>+<key>p</key>)`);
|
||||
command line (<key>${modifierKey}</key>+<key>shift</key>+<key>p</key>)`);
|
||||
} else {
|
||||
$(".pageSettings .tip").html(`
|
||||
tip: You can also change all these settings quickly using the
|
||||
command line (<key>esc</key> or <key>ctrl/cmd</key>+<key>shift</key>+<key>p</key>)`);
|
||||
command line (<key>esc</key> or <key>${modifierKey}</key>+<key>shift</key>+<key>p</key>)`);
|
||||
}
|
||||
|
||||
if (Config.quickRestart === "esc") {
|
||||
$("#bottom .keyTips").html(`
|
||||
<key>esc</key> - restart test<br>
|
||||
<key>tab</key> or <key>ctrl/cmd</key>+<key>shift</key>+<key>p</key> - command line`);
|
||||
<key>tab</key> or <key>${modifierKey}</key>+<key>shift</key>+<key>p</key> - command line`);
|
||||
} else if (Config.quickRestart === "tab") {
|
||||
$("#bottom .keyTips").html(`
|
||||
<key>tab</key> - restart test<br>
|
||||
<key>esc</key> or <key>ctrl/cmd</key>+<key>shift</key>+<key>p</key> - command line`);
|
||||
<key>esc</key> or <key>${modifierKey}</key>+<key>shift</key>+<key>p</key> - command line`);
|
||||
} else {
|
||||
$("#bottom .keyTips").html(`
|
||||
<key>tab</key> + <key>enter</key> - restart test<br>
|
||||
<key>esc</key> or <key>ctrl/cmd</key>+<key>shift</key>+<key>p</key> - command line`);
|
||||
<key>esc</key> or <key>${modifierKey}</key>+<key>shift</key>+<key>p</key> - command line`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue