Skip to content

Commit

Permalink
DYN-8163, DYN-8164 Modify NoteView.xaml.cs to allow for underscore ch…
Browse files Browse the repository at this point in the history
…aracter and bullets from numpad "-" character (#15762)
  • Loading branch information
johnpierson authored Jan 17, 2025
1 parent 91399ef commit 2c89ba7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/DynamoCoreWpf/Views/Core/NoteView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public partial class NoteView : IViewModelView<NoteViewModel>
/// <summary>
/// Special keys definition in note
/// </summary>
internal Key[] specialKeys = { Key.OemMinus, Key.Tab, Key.Enter };
internal Key[] specialKeys = { Key.OemMinus, Key.Subtract, Key.Tab, Key.Enter };

public NoteViewModel ViewModel { get; private set; }

Expand Down Expand Up @@ -210,7 +210,7 @@ private void noteTextBox_LostFocus(object sender, RoutedEventArgs e)

private void noteTextBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (!specialKeys.Contains(e.Key))
if (!specialKeys.Contains(e.Key) || Keyboard.Modifiers == System.Windows.Input.ModifierKeys.Shift)
{
return;
}
Expand All @@ -232,6 +232,9 @@ private void noteTextBox_PreviewKeyDown(object sender, KeyEventArgs e)
case Key.OemMinus:
textBox.Text = BulletDashHandler(text, caretIndex);
break;
case Key.Subtract:
textBox.Text = BulletDashHandler(text, caretIndex);
break;
case Key.Tab:
textBox.Text = BulletTabHandler(text, caretIndex);
break;
Expand Down

0 comments on commit 2c89ba7

Please sign in to comment.