mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-15 15:10:31 -08:00
Update testKeyboardShortcuts.ts
This commit is contained in:
parent
a152317e9d
commit
ee31957186
1 changed files with 8 additions and 1 deletions
|
|
@ -61,7 +61,14 @@ export function initTestKeyboardShortcutFallback(): () => void {
|
|||
const formatComboFromEvent = (event: KeyboardEvent): string => {
|
||||
const combo: string[] = [];
|
||||
const isMac = platform === 'darwin';
|
||||
if (event.ctrlKey || event.metaKey) combo.push(isMac ? 'Cmd' : 'Ctrl');
|
||||
// On macOS, Cmd (metaKey) and Ctrl are distinct and both may be used.
|
||||
// On other platforms, only Ctrl is used as the primary modifier here.
|
||||
if (isMac) {
|
||||
if (event.ctrlKey) combo.push('Ctrl');
|
||||
if (event.metaKey) combo.push('Cmd');
|
||||
} else {
|
||||
if (event.ctrlKey) combo.push('Ctrl');
|
||||
}
|
||||
if (event.altKey) combo.push('Alt');
|
||||
if (event.shiftKey) combo.push('Shift');
|
||||
combo.push(event.key);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue