feat: configurable keybindings for push-to-deafen and quick switcher
CI / Build & Quality Checks (push) Successful in 10m43s
CI / Build & Quality Checks (push) Successful in 10m43s
- Add deafenKey (default M) and quickSwitcherKey (default P) to settingsAtom - Settings → Calls: Push to Deafen keybind tile using shared useKeyBind hook - Settings → Keyboard Shortcuts: new section with Quick Room Switcher keybind - Extract useKeyBind + keyLabel helpers to reduce duplication in Calls section - CallControls reads deafenKey from settings (reactive, re-registers on change) - ClientNonUIFeatures reads quickSwitcherKey from settings (same pattern) - QuickSwitcher now toggles open/closed on repeat press (Ctrl+key again closes) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -83,6 +83,7 @@ export function CallControls({ callEmbed }: CallControlsProps) {
|
||||
}, [shareConfirm]);
|
||||
const [pttMode] = useSetting(settingsAtom, 'pttMode');
|
||||
const [pttKey] = useSetting(settingsAtom, 'pttKey');
|
||||
const [deafenKey] = useSetting(settingsAtom, 'deafenKey');
|
||||
const [lotusTerminal] = useSetting(settingsAtom, 'lotusTerminal');
|
||||
const [pttActive, setPttActive] = useState(false);
|
||||
|
||||
@@ -209,7 +210,7 @@ export function CallControls({ callEmbed }: CallControlsProps) {
|
||||
return false;
|
||||
};
|
||||
const onKeyDown = (e: KeyboardEvent) => {
|
||||
if (e.code !== 'KeyM') return;
|
||||
if (e.code !== deafenKey) return;
|
||||
if (e.repeat) return;
|
||||
if (isEditable(e.target as HTMLElement)) return;
|
||||
e.preventDefault();
|
||||
@@ -217,7 +218,7 @@ export function CallControls({ callEmbed }: CallControlsProps) {
|
||||
};
|
||||
window.addEventListener('keydown', onKeyDown);
|
||||
return () => window.removeEventListener('keydown', onKeyDown);
|
||||
}, [callEmbed]);
|
||||
}, [callEmbed, deafenKey]);
|
||||
|
||||
const [hangupState, hangup] = useAsyncCallback(
|
||||
useCallback(() => callEmbed.hangup(), [callEmbed]),
|
||||
|
||||
Reference in New Issue
Block a user