Use physical keys for voice message shortcut
This commit is contained in:
parent
3e31a7405b
commit
1f0e38f649
1 changed files with 5 additions and 1 deletions
|
@ -4,6 +4,8 @@
|
|||
import { useEffect } from 'react';
|
||||
import { get } from 'lodash';
|
||||
|
||||
import * as KeyboardLayout from '../services/keyboardLayout';
|
||||
|
||||
type KeyboardShortcutHandlerType = (ev: KeyboardEvent) => boolean;
|
||||
|
||||
function isCmdOrCtrl(ev: KeyboardEvent): boolean {
|
||||
|
@ -17,7 +19,9 @@ export function getStartRecordingShortcut(
|
|||
startAudioRecording: () => unknown
|
||||
): KeyboardShortcutHandlerType {
|
||||
return ev => {
|
||||
const { key, shiftKey } = ev;
|
||||
const { shiftKey } = ev;
|
||||
|
||||
const key = KeyboardLayout.lookup(ev);
|
||||
|
||||
if (isCmdOrCtrl(ev) && shiftKey && (key === 'v' || key === 'V')) {
|
||||
startAudioRecording();
|
||||
|
|
Loading…
Reference in a new issue