gh-13612: display "Space" key name correctly in keyboard shortcuts page (gh-13774)

This commit is contained in:
Ashvin Jangid
2026-05-21 12:44:33 +05:30
committed by GitHub
parent 81d30b906a
commit b726dc8052

View File

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