Browse Source

Fixed forum-10719: AvalonEdit swallows Alt+Space

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5480 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
f2bae1ba6e
  1. 6
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs

6
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs

@ -770,12 +770,16 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -770,12 +770,16 @@ namespace ICSharpCode.AvalonEdit.Editing
/// <inheritdoc/>
protected override void OnTextInput(TextCompositionEventArgs e)
{
//Debug.WriteLine("TextInput: Text='" + e.Text + "' SystemText='" + e.SystemText + "' ControlText='" + e.ControlText + "'");
base.OnTextInput(e);
if (!e.Handled && this.Document != null) {
if (e.Text == "\x1b") {
if (string.IsNullOrEmpty(e.Text) || e.Text == "\x1b") {
// ASCII 0x1b = ESC.
// WPF produces a TextInput event with that old ASCII control char
// when Escape is pressed. We'll just ignore it.
// Similarly, some shortcuts like Alt+Space produce an empty TextInput event.
// We have to ignore those (not handle them) to keep the shortcut working.
return;
}
PerformTextInput(e);

Loading…
Cancel
Save