Adds keyboard shortcuts for calling

This commit is contained in:
Josh Perez 2022-05-10 14:14:08 -04:00 committed by GitHub
parent 1b052ad16b
commit fa7b7fcd08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 311 additions and 90 deletions

View file

@ -15,6 +15,7 @@ export type Props = {
type KeyType =
| 'commandOrCtrl'
| 'ctrlOrAlt'
| 'optionOrAlt'
| 'shift'
| 'enter'
@ -40,6 +41,7 @@ type KeyType =
| 'U'
| 'V'
| 'X'
| 'Y'
| '1 to 9';
type ShortcutType = {
description: string;
@ -202,6 +204,30 @@ const CALLING_SHORTCUTS: Array<ShortcutType> = [
description: 'Keyboard--toggle-video',
keys: [['shift', 'V']],
},
{
description: 'Keyboard--accept-video-call',
keys: [['ctrlOrAlt', 'shift', 'V']],
},
{
description: 'Keyboard--accept-audio-call',
keys: [['ctrlOrAlt', 'shift', 'A']],
},
{
description: 'Keyboard--decline-call',
keys: [['ctrlOrAlt', 'shift', 'D']],
},
{
description: 'Keyboard--start-audio-call',
keys: [['ctrlOrAlt', 'shift', 'C']],
},
{
description: 'Keyboard--start-video-call',
keys: [['ctrlOrAlt', 'shift', 'Y']],
},
{
description: 'Keyboard--hang-up',
keys: [['ctrlOrAlt', 'shift', 'E']],
},
];
export const ShortcutGuide = (props: Props): JSX.Element => {
@ -312,6 +338,14 @@ function renderShortcut(
label = i18n('Keyboard--Key--ctrl');
isSquare = false;
}
if (key === 'ctrlOrAlt' && isMacOS) {
label = i18n('Keyboard--Key--ctrl');
isSquare = false;
}
if (key === 'ctrlOrAlt' && !isMacOS) {
label = i18n('Keyboard--Key--alt');
isSquare = false;
}
if (key === 'optionOrAlt' && isMacOS) {
label = i18n('Keyboard--Key--option');
isSquare = false;