feat(hotkeys): chaque raccourci se desactive (Suppr pendant la capture)

Off = vk 0, non enregistre : la combinaison reste libre pour les autres
applis. Combinaisons retenues en pref DPAPI et rejouees au demarrage, pour
qu'un raccourci coupe le reste coffre ferme. Esc annule enfin la capture au
lieu de fermer les reglages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-10-05 18:15:29 +01:00
parent 27afc4e8ca
commit 28f8a42846
5 changed files with 54 additions and 7 deletions
+18 -1
View File
@@ -8043,6 +8043,9 @@ async function init() {
if (e.key !== 'Escape') return;
if (!$('#settingsPanel').classList.contains('is-open')) return;
if (document.querySelector('.modal:not(.is-hidden)')) return;
// Capture de raccourci armee : Esc l'annule (son propre ecouteur,
// enregistre APRES celui-ci), il ne ferme pas les reglages.
if (document.querySelector('[data-capturing="1"]')) return;
// Busy overlay up (sync/backup running) — don't close under it.
if ($('#busyOverlay') && !$('#busyOverlay').classList.contains('is-hidden')) return;
// When the search box has focus AND a query, the input's own
@@ -8390,7 +8393,7 @@ async function init() {
btn.dataset.capturing = '1';
btn.classList.add('is-capturing');
const original = btn.textContent;
btn.textContent = 'Press combo… (Esc to cancel)';
btn.textContent = 'Press combo… (Esc cancel · Del off)';
// Free our own combos so they reach this listener instead of
// firing their hotkey. Restored by finish() / the success path.
hotkeyPushSilent = true;
@@ -8445,6 +8448,20 @@ async function init() {
return;
}
if (captured === 'cancel') { finish(true); return; }
// Cle vide = vk 0 : Delphi n'enregistre pas ce raccourci.
if (captured === 'off') {
const off = { ctrl: false, shift: false, alt: false, win: false, key: '' };
if (kind === 'full') state.autofillHotkeyFull = off;
else if (kind === 'password') state.autofillHotkeyPwd = off;
else if (kind === 'totp') state.autofillHotkeyTotp = off;
else if (kind === 'quickSearch') state.quickSearchHotkey = off;
else /* newEntry */ state.newEntryHotkey = off;
btn.textContent = autofillComboLabel(off);
finish(false);
autofillPushHotkeys();
saveServerSettings();
return;
}
if (captured === 'invalid'){
toast('Unsupported key — use a letter, digit or F-key', 'warning');
finish(true);