1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-06-12 08:29:29 +00:00

Add Ctrl+Enter as a way to close the LVTable edit dialog

When editing local variables, the data grid generally has the input
focus, so hitting Enter doesn't close the dialog.  Rather than play
games with the focus, just take Ctrl+Enter as a shortcut to close
the dialog (same as notes and long comments).

(I found myself hitting Ctrl+Enter automatically, and being annoyed
when it didn't work, so I figured I'd make it official.)
This commit is contained in:
Andy McFadden 2020-08-27 17:09:18 -07:00
parent 69a9e98a43
commit 7c506dceb6
2 changed files with 8 additions and 1 deletions

View File

@ -25,7 +25,8 @@ limitations under the License.
Title="Edit Local Variable Table"
SizeToContent="WidthAndHeight" ResizeMode="NoResize"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
Loaded="Window_Loaded">
Loaded="Window_Loaded"
PreviewKeyDown="Window_KeyEventHandler">
<Window.Resources>
<system:String x:Key="str_ConfirmDelete">Are you sure you want to delete the entire table?</system:String>

View File

@ -274,6 +274,12 @@ namespace SourceGen.WpfGui {
DialogResult = true;
}
private void Window_KeyEventHandler(object sender, KeyEventArgs e) {
if (e.Key == Key.Return && Keyboard.Modifiers.HasFlag(ModifierKeys.Control)) {
OkButton_Click(null, null);
}
}
private void DeleteTableButton_Click(object sender, RoutedEventArgs e) {
MessageBoxResult result = MessageBox.Show((string)FindResource("str_ConfirmDelete"),
(string)FindResource("str_ConfirmDeleteCaption"),