Simplify platform-specific keyboard layouts with Accel key and global platform variable (#748)

* Simplify platform-specific keyboard layouts with Accel key and global platform variable


Co-authored-by: Dennis <dennis@kobert.dev>
This commit is contained in:
Keavon Chambers
2022-08-13 13:28:02 +02:00
committed by GitHub
co-authored by Dennis
parent d8ae727ea9
commit 776992a297
24 changed files with 240 additions and 315 deletions
@@ -195,8 +195,11 @@ export default defineComponent({
let key = keyWithLabel.key;
const label = keyWithLabel.label;
// Replace Alt with Option on Mac
if (key === "Alt" && platformIsMac()) key = "Option";
// Replace Alt and Accel keys with their Mac-specific equivalents
if (platformIsMac()) {
if (key === "Alt") key = "Option";
if (key === "Accel") key = "Command";
}
// Either display an icon...
// @ts-expect-error We want undefined if it isn't in the object