Document keyboard shortcuts (#7908)

This commit is contained in:
Šimon Brandner 2022-03-04 13:14:52 +01:00 committed by GitHub
parent 84bd136657
commit a58b1e9d79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 91 additions and 19 deletions

View file

@ -18,7 +18,7 @@ limitations under the License.
import React from "react";
import {
getKeyboardShortcuts,
getKeyboardShortcutsForUI,
ALTERNATE_KEY_NAME,
KEY_ICON,
ICategory,
@ -32,11 +32,11 @@ import { _t } from "../../../../../languageHandler";
// TODO: This should return KeyCombo but it has ctrlOrCmd instead of ctrlOrCmdKey
const getKeyboardShortcutValue = (name: string): KeyBindingConfig => {
return getKeyboardShortcuts()[name]?.default;
return getKeyboardShortcutsForUI()[name]?.default;
};
const getKeyboardShortcutDisplayName = (name: string): string | null => {
const keyboardShortcutDisplayName = getKeyboardShortcuts()[name]?.displayName;
const keyboardShortcutDisplayName = getKeyboardShortcutsForUI()[name]?.displayName;
return keyboardShortcutDisplayName && _t(keyboardShortcutDisplayName);
};