mirror of
https://github.com/zen-browser/desktop.git
synced 2026-05-23 13:20:16 +00:00
gh-13612: display "Space" key name correctly in keyboard shortcuts page (gh-13774)
This commit is contained in:
@@ -32,7 +32,6 @@ const KEYCODE_MAP = {
|
||||
TAB: "VK_TAB",
|
||||
ENTER: "VK_RETURN",
|
||||
ESCAPE: "VK_ESCAPE",
|
||||
SPACE: "VK_SPACE",
|
||||
ARROWLEFT: "VK_LEFT",
|
||||
ARROWRIGHT: "VK_RIGHT",
|
||||
ARROWUP: "VK_UP",
|
||||
@@ -560,7 +559,13 @@ class KeyShortcut {
|
||||
static keyToDisplayString(key, keycode) {
|
||||
let str = "";
|
||||
if (key) {
|
||||
str += key.toUpperCase();
|
||||
switch (key) {
|
||||
case " ":
|
||||
str += AppConstants.platform == "macosx" ? "␣" : "Space";
|
||||
break;
|
||||
default:
|
||||
str += key.toUpperCase();
|
||||
}
|
||||
} else if (keycode) {
|
||||
// Get the key from the value
|
||||
for (let [k, value] of Object.entries(KEYCODE_MAP)) {
|
||||
@@ -585,9 +590,6 @@ class KeyShortcut {
|
||||
case "enter":
|
||||
str += AppConstants.platform == "macosx" ? "↩" : "Enter";
|
||||
break;
|
||||
case "space":
|
||||
str += AppConstants.platform == "macosx" ? "␣" : "Space";
|
||||
break;
|
||||
default:
|
||||
str += normalizedKey;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user