Skip to content

Commit 7ca1c55

Browse files
committed
feature: allow Doubao detecting selection in commit message box on Windows
Signed-off-by: leo <longshuang@msn.cn>
1 parent bc6d837 commit 7ca1c55

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Views/CommitMessageToolBox.axaml.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Avalonia;
77
using Avalonia.Controls;
88
using Avalonia.Controls.Primitives;
9+
using Avalonia.Input;
910
using Avalonia.Interactivity;
1011
using Avalonia.Layout;
1112
using Avalonia.Media;
@@ -273,6 +274,19 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
273274
}
274275
}
275276

277+
protected override void OnKeyDown(KeyEventArgs e)
278+
{
279+
// Supports Ctrl+Insert for copy. (Doubao uses Ctrl+Insert to detect selection)
280+
if (e.Key == Key.Insert && e.KeyModifiers == KeyModifiers.Control)
281+
{
282+
Copy();
283+
e.Handled = true;
284+
return;
285+
}
286+
287+
base.OnKeyDown(e);
288+
}
289+
276290
protected override void OnTextChanged(EventArgs e)
277291
{
278292
base.OnTextChanged(e);

0 commit comments

Comments
 (0)