-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
firebase-deployment: https://evy-lang--107-wk3w8m4y.web.app (672617e) |
35a4d2d
to
a09210b
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
cd66414
to
87a617d
Compare
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.
87a617d
to
672617e
Compare
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!