Lose focus when pressing esc on editbox

This commit is contained in:
Daniel Collin 2013-10-19 19:06:36 +02:00
parent aee91adb5f
commit 1b44d36667

View File

@ -976,6 +976,13 @@ void Emgui_editBoxXY(int x, int y, int width, int height, int bufferLength, char
switch (keyCode) switch (keyCode)
{ {
case EMGUI_KEY_ESC :
{
g_emguiGuiState.kbdItem = -1;
g_emguiGuiState.keyCode = 0;
break;
}
case EMGUI_KEY_TAB : case EMGUI_KEY_TAB :
{ {
if (g_emguiGuiState.keyMod & EMGUI_KEY_SHIFT) if (g_emguiGuiState.keyMod & EMGUI_KEY_SHIFT)
@ -1092,6 +1099,14 @@ void Emgui_setFirstControlFocus()
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void Emgui_resetFocus()
{
g_emguiGuiState.kbdItem = -1;
g_emguiGuiState.keyCode = 0;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void Emgui_setLayer(int layer) void Emgui_setLayer(int layer)
{ {
s_activeLayer = layer; s_activeLayer = layer;