mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
make esc close modals
This commit is contained in:
parent
af40ad1aba
commit
9512e87226
1 changed files with 13 additions and 1 deletions
|
|
@ -33,28 +33,40 @@ export const Analyser = (props: AnalyseProps) => {
|
|||
const [sessionName, setSessionName] = createSignal<string>("");
|
||||
const [clients, setClients] = createSignal<number>(0);
|
||||
const [helpOpen, setHelpOpen] = createSignal<boolean>(false);
|
||||
const closeDialogs = () => {
|
||||
setHelpOpen(false);
|
||||
};
|
||||
|
||||
createEffect(() => {
|
||||
const e = event();
|
||||
|
||||
untrack(() => {
|
||||
console.log(e);
|
||||
if (e) {
|
||||
if (e.key === '.') {
|
||||
seek(1);
|
||||
e.preventDefault();
|
||||
}
|
||||
if (e.key === ',') {
|
||||
seek(-1);
|
||||
e.preventDefault();
|
||||
}
|
||||
if (e.key === 'ArrowRight') {
|
||||
seek(15);
|
||||
e.preventDefault();
|
||||
}
|
||||
if (e.key === 'ArrowLeft') {
|
||||
seek(-15);
|
||||
e.preventDefault();
|
||||
}
|
||||
if (e.key === ' ') {
|
||||
togglePlay();
|
||||
e.preventDefault();
|
||||
}
|
||||
if (e.key === 'Escape') {
|
||||
closeDialogs();
|
||||
e.preventDefault();
|
||||
}
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue