Support Backspace for remove actions in UI lists

Changed key handling and menu input gestures to allow Backspace (in addition to Delete) for removing items in server, profile, and routing rule lists. This improves usability and consistency across both Avalonia and WPF views.
This commit is contained in:
2dust
2025-11-18 16:54:42 +08:00
parent 84f812c8ee
commit 2ebd2b28a8
15 changed files with 168 additions and 129 deletions
@@ -73,18 +73,27 @@ public partial class RoutingSettingWindow : WindowBase<RoutingSettingViewModel>
{
if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta)
{
if (e.Key == Key.A)
switch (e.Key)
{
lstRoutings.SelectAll();
case Key.A:
lstRoutings.SelectAll();
break;
}
}
else if (e.Key is Key.Enter or Key.Return)
else
{
ViewModel?.RoutingAdvancedSetDefault();
}
else if (e.Key == Key.Delete)
{
ViewModel?.RoutingAdvancedRemoveAsync();
switch (e.Key)
{
case Key.Enter:
//case Key.Return:
ViewModel?.RoutingAdvancedSetDefault();
break;
case Key.Delete:
case Key.Back:
ViewModel?.RoutingAdvancedRemoveAsync();
break;
}
}
}