aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend/GUI
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.Frontend/GUI')
-rw-r--r--ShiftOS.Frontend/GUI/TextInput.cs23
1 files changed, 13 insertions, 10 deletions
diff --git a/ShiftOS.Frontend/GUI/TextInput.cs b/ShiftOS.Frontend/GUI/TextInput.cs
index 381541b..36e21b1 100644
--- a/ShiftOS.Frontend/GUI/TextInput.cs
+++ b/ShiftOS.Frontend/GUI/TextInput.cs
@@ -78,14 +78,6 @@ namespace ShiftOS.Frontend.GUI
_index--;
}
- if(e.Key == Microsoft.Xna.Framework.Input.Keys.Back)
- {
- if(_index > 0)
- {
- _text = _text.Remove(_index - 1, 1);
- _index--;
- }
- }
if(e.Key == Microsoft.Xna.Framework.Input.Keys.Delete)
{
if(_index < _text.Length - 1)
@@ -97,8 +89,19 @@ namespace ShiftOS.Frontend.GUI
if (_index < _text.Length)
_index++;
if (e.KeyChar != '\0') {
- _text = _text.Insert(_index, e.KeyChar.ToString());
- _index++;
+ if (e.KeyChar == '\b')
+ {
+ if (_index > 0)
+ {
+ _text = _text.Remove(_index - 1, 1);
+ _index--;
+ }
+ }
+ else
+ {
+ _text = _text.Insert(_index, e.KeyChar.ToString());
+ _index++;
+ }
}
caretMS = 0;
CalculateVisibleText();