Remap voice recording shortcut to fix Paste Match Style

This commit is contained in:
ayumi-signal 2024-05-29 14:53:35 -07:00 committed by GitHub
parent 481928fa4f
commit 94a262b799
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View file

@ -159,7 +159,7 @@ function getNavigationShortcuts(i18n: LocalizerType): Array<ShortcutType> {
{
id: 'Keyboard--begin-recording-voice-note',
description: i18n('icu:Keyboard--begin-recording-voice-note'),
keys: [['commandOrCtrl', 'shift', 'V']],
keys: [['commandOrCtrl', 'shift', 'Y']],
},
{
id: 'Keyboard--archive-conversation',

View file

@ -203,10 +203,16 @@ export function useStartRecordingShortcut(
return false;
}
const { shiftKey } = ev;
const key = KeyboardLayout.lookup(ev);
if (isCmdOrCtrl(ev) && shiftKey && (key === 'v' || key === 'V')) {
if (
hasExactModifiers(ev, {
controlOrMeta: true,
shift: true,
alt: false,
}) &&
(key === 'y' || key === 'Y')
) {
ev.preventDefault();
ev.stopPropagation();