feat: add application quit binding

This commit is contained in:
tux
2025-07-03 01:58:31 +05:30
parent d907e75996
commit e9e660807a
2 changed files with 9 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ Get the appropriate binary for your platform from the [release page](https://git
|--------------------------------|----------------------------------------------------------------------------------------------------------------|
| `Shift` + `\` | Toggle Window Visibility |
| `Shift` + `S` | Capture screenshot and send to LLM |
| `Alt` + `Shift` + `Q` | Quit application |
| `Ctrl` + `Alt` + `Shift` + `H` | Make windows visible to screenshare.<br> **Note: Application restart is required to make it invisible again.** |
<!-- CONTRIBUTING -->

View File

@@ -1,6 +1,8 @@
using Avalonia.Controls;
using System;
using System.Net.Quic;
using System.Runtime.InteropServices;
using Avalonia;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
@@ -81,6 +83,7 @@ public partial class MainWindow : Window
bool hasH = e.Data.KeyCode == KeyCode.VcH;
bool hasBackslash = e.Data.KeyCode == KeyCode.VcBackslash;
bool hasS = e.Data.KeyCode == KeyCode.VcS;
bool hasQ = e.Data.KeyCode == KeyCode.VcQ;
if (hasCtrl && hasShift && hasAlt && hasH)
{
@@ -92,6 +95,11 @@ public partial class MainWindow : Window
Dispatcher.UIThread.Post(() => { _chatUserControl.SendScreenshot(); });
}
if (hasAlt && hasShift && hasQ)
{
Dispatcher.UIThread.Post(() => { Environment.Exit(0); });
}
if (hasShift && hasBackslash)
{
Dispatcher.UIThread.Post(() =>