From 981d34dbc1c397c09a1eceb0d9d81527f29e4876 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Thu, 31 Oct 2024 08:02:24 -0600 Subject: [PATCH] add handlers for C-w and C-q --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.go b/main.go index 730b10d..d5afb51 100644 --- a/main.go +++ b/main.go @@ -117,6 +117,15 @@ func main() { ), ) + ctrlQ := &desktop.CustomShortcut{KeyName: fyne.KeyQ, Modifier: fyne.KeyModifierControl} + ctrlW := &desktop.CustomShortcut{KeyName: fyne.KeyW, Modifier: fyne.KeyModifierControl} + w.Canvas().AddShortcut(ctrlQ, func(shortcut fyne.Shortcut) { + a.Quit() + }) + w.Canvas().AddShortcut(ctrlW, func(shortcut fyne.Shortcut) { + w.Hide() + }) + go func() { duration := workTime w.Hide()