mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Use physical keys for voice message shortcut
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user