Skip to content

Commit 82896fc

Browse files
committed
refactor: move ALTERNATE_KEY_NAME in shared-components
1 parent 0afb0a0 commit 82896fc

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

src/accessibility/KeyboardShortcuts.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import { _td, type TranslationKey } from "../shared-components/i18n";
1313
import { IS_MAC, IS_ELECTRON, Key } from "../shared-components/Keyboard";
1414
import { type IBaseSetting } from "../settings/Settings";
1515
import { type KeyCombo } from "../KeyBindingsManager";
16+
import { DIGITS } from "../shared-components/KeyboardShortcuts";
17+
18+
export { DIGITS, ALTERNATE_KEY_NAME } from "../shared-components/KeyboardShortcuts";
1619

1720
export enum KeyBindingAction {
1821
/** Send a message */
@@ -175,22 +178,6 @@ export enum CategoryName {
175178
LABS = "Labs",
176179
}
177180

178-
// Meta-key representing the digits [0-9] often found at the top of standard keyboard layouts
179-
export const DIGITS = "digits";
180-
181-
export const ALTERNATE_KEY_NAME: Record<string, TranslationKey> = {
182-
[Key.PAGE_UP]: _td("keyboard|page_up"),
183-
[Key.PAGE_DOWN]: _td("keyboard|page_down"),
184-
[Key.ESCAPE]: _td("keyboard|escape"),
185-
[Key.ENTER]: _td("keyboard|enter"),
186-
[Key.SPACE]: _td("keyboard|space"),
187-
[Key.HOME]: _td("keyboard|home"),
188-
[Key.END]: _td("keyboard|end"),
189-
[Key.ALT]: _td("keyboard|alt"),
190-
[Key.CONTROL]: _td("keyboard|control"),
191-
[Key.SHIFT]: _td("keyboard|shift"),
192-
[DIGITS]: _td("keyboard|number"),
193-
};
194181
export const KEY_ICON: Record<string, string> = {
195182
[Key.ARROW_UP]: "↑",
196183
[Key.ARROW_DOWN]: "↓",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2025 New Vector Ltd.
3+
*
4+
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
5+
* Please see LICENSE files in the repository root for full details.
6+
*/
7+
8+
import { _td, type TranslationKey } from "./i18n";
9+
import { Key } from "./Keyboard";
10+
11+
// Meta-key representing the digits [0-9] often found at the top of standard keyboard layouts
12+
export const DIGITS = "digits";
13+
14+
export const ALTERNATE_KEY_NAME: Record<string, TranslationKey> = {
15+
[Key.PAGE_UP]: _td("keyboard|page_up"),
16+
[Key.PAGE_DOWN]: _td("keyboard|page_down"),
17+
[Key.ESCAPE]: _td("keyboard|escape"),
18+
[Key.ENTER]: _td("keyboard|enter"),
19+
[Key.SPACE]: _td("keyboard|space"),
20+
[Key.HOME]: _td("keyboard|home"),
21+
[Key.END]: _td("keyboard|end"),
22+
[Key.ALT]: _td("keyboard|alt"),
23+
[Key.CONTROL]: _td("keyboard|control"),
24+
[Key.SHIFT]: _td("keyboard|shift"),
25+
[DIGITS]: _td("keyboard|number"),
26+
};

0 commit comments

Comments
 (0)