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:
Daniel Huang 2022-09-18 05:21:22 -04:00 committed by GitHub
parent 9396b1b3f8
commit fc7fdb8d98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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`);
}
}