fix android egl errors, implement android backspace in text input
This commit is contained in:
@@ -82,14 +82,7 @@ kEventResult NodeTextInput::handle_event(Event* e)
|
||||
case kEventType::KeyUp:
|
||||
if (ke->m_key == kKey::KeyEnter && on_return)
|
||||
on_return(this);
|
||||
break;
|
||||
case kEventType::KeyChar:
|
||||
if (m_cursor)
|
||||
{
|
||||
timer = 0;
|
||||
m_cursor->m_display = true;
|
||||
}
|
||||
if (ke->m_char == '\b') // backspace
|
||||
if (ke->m_key == kKey::KeyBackspace)
|
||||
{
|
||||
if (!m_string.empty())
|
||||
{
|
||||
@@ -97,7 +90,16 @@ kEventResult NodeTextInput::handle_event(Event* e)
|
||||
m_text->set_text(m_string.c_str());
|
||||
}
|
||||
}
|
||||
else if (ke->m_char == 0x7f) // DEL
|
||||
break;
|
||||
case kEventType::KeyChar:
|
||||
if (m_cursor)
|
||||
{
|
||||
timer = 0;
|
||||
m_cursor->m_display = true;
|
||||
}
|
||||
if (ke->m_char == '\b' // backspace
|
||||
|| ke->m_char == 0x7f // DEL
|
||||
)
|
||||
{
|
||||
if (!m_string.empty())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user