Add basic IME support to SDL2 video driver

This commit is contained in:
Jonathan G Rennison
2019-10-06 01:10:41 +01:00
parent edfd378e93
commit a4c677a571
7 changed files with 59 additions and 2 deletions

View File

@@ -502,11 +502,20 @@ bool Window::SetFocusedWidget(int widget_index)
if (this->nested_focus->type == WWT_EDITBOX) VideoDriver::GetInstance()->EditBoxLostFocus();
}
this->nested_focus = this->GetWidget<NWidgetCore>(widget_index);
if (this->nested_focus->type == WWT_EDITBOX) VideoDriver::GetInstance()->EditBoxGainedFocus();
return true;
}
/**
* Called when window looses focus
* Called when window gains focus
*/
void Window::OnFocus(Window *previously_focused_window)
{
if (this->nested_focus != nullptr && this->nested_focus->type == WWT_EDITBOX) VideoDriver::GetInstance()->EditBoxGainedFocus();
}
/**
* Called when window loses focus
*/
void Window::OnFocusLost(Window *newly_focused_window)
{