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

frontend: Extend events sample #107

Merged
merged 3 commits into from
Mar 17, 2023
Merged

frontend: Extend events sample #107

merged 3 commits into from
Mar 17, 2023

Conversation

juliaogris
Copy link
Member

Extend events sample to include animation with key events. While testing
this sample it became obvious that the cmd+enter shortcut to start a
program should remove focus from the editor so that key events get
registered, fixed.

Thanks @fcostin for the idea!

@github-actions
Copy link

github-actions bot commented Mar 17, 2023

firebase-deployment: https://evy-lang--107-wk3w8m4y.web.app (672617e)

Copy link
Contributor

@camh- camh- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍀

dot x y radius hue

on animate
if stopped
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very tricksy! I was trying to figure out how an evy program actually stopped itself and wondered if there was something magical about this stopped variable. Turns out it was just that the run/stop button had focus so it also triggers when you press space. If you move the focus away manually and press space, the dot stops but not the program.

Just commenting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, good point! I always use cmd+enter to start the program these days.
I've added an unfocusRunButton function if we register the key-listener.
Let me know if you like that.

Improve cmd+enter shortcut to start a program so that key events will be
listened to straight away. If the focus remains on the editor the key
events are ignored so that code can be edited while a program is
running. Before this change one had to click on the canvas before key
events came in to the evy program.
@juliaogris juliaogris force-pushed the events-sample branch 2 times, most recently from cd66414 to 87a617d Compare March 17, 2023 21:59
Unfocus run button when listening to key so that the space or enter bar
doesn't stop the program.
Extend events sample to include animation with key events.
@juliaogris juliaogris merged commit a8655a7 into master Mar 17, 2023
@juliaogris juliaogris deleted the events-sample branch March 17, 2023 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants