Add close and refresh keybinds

This commit is contained in:
2024-08-19 11:01:48 +02:00
parent 768b43a21c
commit 272cfca55c
4 changed files with 27 additions and 0 deletions

View File

@@ -2,6 +2,16 @@
import Header from "$lib/components/Header.svelte";
import Router from "$lib/router/Router.svelte";
import { Toaster } from "svelte-sonner";
import { Close } from '$wails/main/App'
function keyDown(event: KeyboardEvent) {
if (event.ctrlKey && event.key == "r") {
window.location.reload();
}
if (event.ctrlKey && event.key == "w") {
Close();
}
}
</script>
<!--
@@ -55,6 +65,7 @@ toast('Hello World', {
<Toaster hotkey={['KeyC']} />
-->
<svelte:window on:keydown={keyDown} />
<Toaster theme="dark" expand visibleToasts={9} />
<template>
<Header />

4
frontend/wailsjs/go/main/App.d.ts vendored Normal file
View File

@@ -0,0 +1,4 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function Close():Promise<void>;

View File

@@ -0,0 +1,7 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function Close() {
return window['go']['main']['App']['Close']();
}