Textfield backspace remove char not working on wsl

This commit is contained in:
Nick Van Dyck
2018-05-05 21:51:12 +01:00
parent 2f25941dad
commit a749030549
2 changed files with 9 additions and 0 deletions

View File

@@ -566,6 +566,7 @@ namespace Terminal.Gui {
case Curses.KeyDeleteChar: return Key.DeleteChar;
case Curses.KeyInsertChar: return Key.InsertChar;
case Curses.KeyBackTab: return Key.BackTab;
case Curses.KeyBackspace: return Key.Backspace;
default: return Key.Unknown;
}
}

View File

@@ -160,6 +160,14 @@ namespace Terminal.Gui {
{
switch (kb.Key) {
case Key.Delete:
case Key.DeleteChar:
if (text.Length == 0 || text.Length == point)
return true;
SetText (text [0, point] + text [point + 1, null]);
Adjust ();
break;
case Key.Backspace:
if (point == 0)
return true;