Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions olcPixelGameEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -4406,10 +4406,17 @@ namespace olc
nTextEntryCursor = std::max(0, nTextEntryCursor - 1);
else if (sym == "_R")
nTextEntryCursor = std::min(int32_t(sTextEntryString.size()), nTextEntryCursor + 1);
else if (sym == "\b" && nTextEntryCursor > 0)
else if (sym == "\b")
{
sTextEntryString.erase(nTextEntryCursor - 1, 1);
nTextEntryCursor = std::max(0, nTextEntryCursor - 1);
if (nTextEntryCursor > 0)
{
sTextEntryString.erase(nTextEntryCursor - 1, 1);
nTextEntryCursor = std::max(0, nTextEntryCursor - 1);
}
else
{
// Consume the backspace character to prevent it from ending up in the TextEntry string
}
}
else if (sym == "_X" && size_t(nTextEntryCursor) < sTextEntryString.size())
sTextEntryString.erase(nTextEntryCursor, 1);
Expand Down