Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playground: Incorrect focus logic #146

Open
vtereshkov opened this issue Feb 19, 2024 · 6 comments
Open

Playground: Incorrect focus logic #146

vtereshkov opened this issue Feb 19, 2024 · 6 comments
Labels
bug Something isn't working wasm

Comments

@vtereshkov
Copy link
Contributor

vtereshkov commented Feb 19, 2024

Despite the fact that floooh/sokol#822 is now closed, it has not resolved our problems with the moving rectangle example in the web playground:

  1. When I build tophat with the official Sokol, the text area doesn't receive any keystrokes at all -- they are all caught by the example window.

  2. When I return false from _sapp_emsc_key_cb(), all keys are caught by both the text area and the example window

Built with Emscripten 3.1.10.

@marekmaskarinec marekmaskarinec added bug Something isn't working wasm labels Feb 20, 2024
@skejeton
Copy link
Member

When we were having issues with SAVESCUM de-focusing I applied quick fix so that every time you resize and click the window, it will focus on the canvas.

If you use the shell.html from tophat - that is the reason.

@vtereshkov
Copy link
Contributor Author

@skejeton Do you mean we need to implement switching the input focus between the text area and the example window? Are you sure this is possible with the official Sokol? Great if it is. But your SaveScum build was using a customized Sokol fork.

@marekmaskarinec
Copy link
Member

I did some changes to the playground and I can now finally recreate your issue.

@marekmaskarinec
Copy link
Member

I found the issue: the newly added event bubble up options were not enabled by tophat. I fixed this in the recent commit. Now it is possible to use the text box. However the issue with both the text box and the game catching the inputs is still there. This issue will require some more work.

marekmaskarinec added a commit that referenced this issue Feb 22, 2024
Signed-off-by: Marek Maškarinec <marek@mrms.cz>
@marekmaskarinec
Copy link
Member

The new playground is now uploaded to the website.

@marekmaskarinec marekmaskarinec changed the title Playground: Keystrokes are still not handled properly Playground: Incorrect focus logic Feb 22, 2024
@vtereshkov
Copy link
Contributor Author

I tested the moving rectangle example with the latest version. The only problem is that the WASD keys, when entered in the text area, are also caught by the example window. This is a slightly annoying bug, but not a release blocker,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wasm
Projects
None yet
Development

No branches or pull requests

3 participants