ソースを参照

Reverted keyboard device

Jurjen Biewenga 8 年 前
コミット
0590465a0a
1 ファイル変更9 行追加25 行削除
  1. 9 25
      src/Avalonia.Input/KeyboardDevice.cs

+ 9 - 25
src/Avalonia.Input/KeyboardDevice.cs

@@ -23,8 +23,6 @@ namespace Avalonia.Input
         public IInputManager InputManager => AvaloniaLocator.Current.GetService<IInputManager>();
 
         public IFocusManager FocusManager => AvaloniaLocator.Current.GetService<IFocusManager>();
-        
-        public string[] invalidCharacters = new String[1]{""};
 
         public IInputElement FocusedElement
         {
@@ -124,32 +122,18 @@ namespace Avalonia.Input
 
                 if (text != null)
                 {
-                    string cleanedText = RemoveInvalidCharacters(text.Text);
-                    if (!string.IsNullOrEmpty(cleanedText))
+                    var ev = new TextInputEventArgs()
                     {
-                        var ev = new TextInputEventArgs()
-                                 {
-                                     Device = this,
-                                     Text = cleanedText,
-                                     Source = element,
-                                     RoutedEvent = InputElement.TextInputEvent
-                                 };
-
-                        element.RaiseEvent(ev);
-                        e.Handled = ev.Handled;
-                    }
+                        Device = this,
+                        Text = text.Text,
+                        Source = element,
+                        RoutedEvent = InputElement.TextInputEvent
+                    };
+
+                    element.RaiseEvent(ev);
+                    e.Handled = ev.Handled;
                 }
             }
         }
-
-        public string RemoveInvalidCharacters(string text)
-        {
-            for (var i = 0; i < invalidCharacters.Length; i++)
-            {
-                text = text.Replace(invalidCharacters[i], string.Empty);
-            }
-
-            return text;
-        }
     }
 }