I’m having an odd issue with ExternalWindow. I’m working with wxWidgets + Urho3D using a custom wxPanel to provide a HWND that I sent to Urho3D. It renders perfectly, but I seem to get no input. In fact, only SDL_WINDOWEVENT gets fired.
Thinking that this was some input handling issue, I attempted to manually process events as so:
void wxUrho3D::OnKeyUp(wxKeyEvent& event)
{
SDL_Event sdlEvent;
sdlEvent.type = SDL_KEYUP;
sdlEvent.key.keysym.sym = event.GetKeyCode();
sdlEvent.key.keysym.mod = event.GetModifiers();
SDL_PushEvent(&sdlEvent);
}
void wxUrho3D::OnKeyDown(wxKeyEvent& event)
{
SDL_Event sdlEvent;
sdlEvent.type = SDL_KEYDOWN;
sdlEvent.key.keysym.sym = event.GetKeyCode();
sdlEvent.key.keysym.mod = event.GetModifiers();
SDL_PushEvent(&sdlEvent);
}
void wxUrho3D::OnMouseUp(wxMouseEvent& event)
{
SDL_Event sdlEvent;
sdlEvent.type = SDL_MOUSEBUTTONUP;
sdlEvent.button.state = SDL_RELEASED;
sdlEvent.button.button = SDL_BUTTON_LEFT;
auto position = event.GetPosition();
sdlEvent.button.x = position.x;
sdlEvent.button.y = position.y;
SDL_PushEvent(&sdlEvent);
}
void wxUrho3D::OnMouseDown(wxMouseEvent& event)
{
SDL_Event sdlEvent;
sdlEvent.type = SDL_MOUSEBUTTONDOWN;
sdlEvent.button.state = SDL_PRESSED;
sdlEvent.button.button = SDL_BUTTON_LEFT;
auto position = event.GetPosition();
sdlEvent.button.x = position.x;
sdlEvent.button.y = position.y;
SDL_PushEvent(&sdlEvent);
}
These functions are firing correctly, however Urho3D doesn’t seem to be processing the SDL events. Any ideas on what’s going on?