Support for backspace when editing track values

Closes #57
This commit is contained in:
Daniel Collin 2013-01-06 22:19:28 +01:00
parent 251d7b146a
commit 8c8995dbf0

View File

@ -1378,7 +1378,7 @@ static bool doEditing(int key)
if (key == '.' && !is_editing) if (key == '.' && !is_editing)
return false; return false;
if ((key >= '0' && key <= '9') || key == '.' || key == '-') if ((key >= '0' && key <= '9') || key == '.' || key == '-' || key == EMGUI_KEY_BACKSPACE)
{ {
if (!is_editing) if (!is_editing)
{ {
@ -1386,7 +1386,11 @@ static bool doEditing(int key)
is_editing = true; is_editing = true;
} }
if (key == EMGUI_KEY_BACKSPACE)
s_editBuffer[emaxi(strlen(s_editBuffer) - 1, 0)] = 0;
else
s_editBuffer[strlen(s_editBuffer)] = (char)key; s_editBuffer[strlen(s_editBuffer)] = (char)key;
s_editorData.trackData.editText = s_editBuffer; s_editorData.trackData.editText = s_editBuffer;
return true; return true;