Verb "present" only partially starts a shared project

Shared project opens using the URL and even shows the visual presentation that would immediately follow clicking the green flag. So far so good, but wait.

Unfortunately the project does not "play" the rest of its code until after the viewer manually clicks the green flag again. After that, the code executes correctly.

This behavior differs from the user manual's description of the "present" verb, which seems to say that the verb will cause the code to be executed.

I've encountered this same discrepancy with other shared Snap! projects in recent days. It happens both in Chrome and in Safari. The Mac OS is Big Sur. Browsers and OS all totally up to date.

Just trying to understand. Maybe this is how things are supposed to happen now?

Has something changed on the Snap! side of things, leaving the manual slightly out of date?

Nice project! I love how you generate the procedures programmatically. :~)

The manual is correct but leaves out an important detail: For some reason I don't understand (I'm sure Jens does), Snap! doesn't detect keystrokes until you click on the stage.

  1. Your project link doesn't work veryu well - can you try editing your post and repasting it in using the link button

  2. It works OK if you click anywhere on the stage. It looks like your complex keyboard reading routine doesn't have focus until something like this is done

Very nice, I like the poem!

Thanks for those kind words. I think I can explain that bit about clicking on the stage. It's not the stage, actually, but anywhere inside the browser window! Try it, you'll see.

Then try this. Get a project going in the editing window that senses keyboard. Then click outside the browser window. No surprise, sprites stop responding to keyboard until you click back into the browser window.

Now that I think about it, certainly the keystrokes would not go to the browser window unless and until the focus gets placed into that window. That's true for all applications.

What seems to happen when loading a shared script is that somehow the focus leaves the browser window during the course of fetching the page and initially rendering it.

That does not look like a behavior of Snap! uniquely but rather one of browsers generally. Never noticed this "feature" because one usually clicks an input box somewhere in a browser window before typing into it.

Now we know. For keyboard, click the focus back into the browser window after the shared project opens.

Even old dogs can learn. They just have to wake up from their naps first.

Easier said than done, for me, these days. It's 3:30 and I'm not dressed yet even though I have things to do out in the world.