Closed CaseyCarlin closed 4 months ago
Oh, that's quite bad actually, I wonder how nobody came across that until now.
I cross-checked with the SDL2 and GLFW application implementations and they emit both events, so it makes sense to do that here as well. Did some more adjustments to make the accept status propagate from both the press and key events (because otherwise they'd get propagated further to the page / browser), and commited the fix as 536d4e75fe54b9f2b060b0e52f7af627b7a80d9b.
Thank you!
Thank you as well!
The keyboard handler in the emscripten backend has this section:
The comment says "pass it to the text input event as well" but this conditional returns instead.
Because of this, when passing events to the Magnum ImGui integration, ImGui will only ever get a KeyDown event or a TextInput event; never both. Furthermore, if ImGui does not get a key event to correspond with a text event, keyboard shortcuts never fire inside Input widgets.
Based on the code comment above, it seems like
return e.isAccepted();
should be removed, and indeed in my local branch this does re-enable keyboard shortcuts in input widgets with no apparent ill effects.