Remap voice recording shortcut to fix Paste Match Style

Co-authored-by: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2024-05-29 17:08:59 -05:00 committed by GitHub
parent 99874a3c19
commit 5aa5b6a230
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();