How can I get the event occured from flyout?

68 views
Skip to first unread message

Jay An(안재현)

unread,
Feb 5, 2024, 3:12:22 AM2/5/24
to Blockly
Hi :)

I want to make selected block to unselected when the flyout is opened.

In order to make this functionality, I need to know when the flyout is clicked however I could not find it from flyout document.

How can I make this?

Maribeth Moffatt

unread,
Feb 5, 2024, 5:11:17 PM2/5/24
to Blockly
Hello,

Blockly has an event listener system where you can register change listener functions that will be called whenever Blockly fires an event. You should create a change listener and listen for the "ToolboxItemSelected" event.

Best,
Maribeth

An(안재현)Jay

unread,
Feb 6, 2024, 2:07:54 AM2/6/24
to blo...@googlegroups.com
Hello,

I said I wanted to unselect the block when the flyout was opened but this was a mistake. (Sorry)

It was a toolbox not the flyout. Therefore I want to make the block unselected when the toolbox is clicked.

By the way, I am using blockly version 3.20200402.1 which was released 4 years ago.

Is ToolboxItemSelected event available in this version? If not, what event method should I use?

Thank you :)

2024년 2월 6일 (화) 오전 7:11, 'Maribeth Moffatt' via Blockly <blo...@googlegroups.com>님이 작성:
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/12a12f22-6fdd-4470-b097-97c5ac141cd9n%40googlegroups.com.
Message has been deleted

Maribeth Moffatt

unread,
Feb 7, 2024, 2:35:02 PM2/7/24
to Blockly
Hi,

Unfortunately it is difficult for us to provide support for versions going back that far. I looked through the code from that version and it looks like the `ToolboxItemSelected` event didn't exist yet, so Blockly doesn't fire an event for a toolbox category being selected in that version. I don't have any other ideas for you that might be straightforward to implement, but you are welcome to look through the code yourself to see if you can find something.

We do strongly recommend that you update to a newer version if possible. It will be easier to use our docs and get support here in the forum, plus you'll get access to all the features we've added in the past four years! If you run into any problems while updating, we'd be happy to help resolve them here in the forum.

Best,
Maribeth

PS: Sorry if you receive this twice, I thought I sent it before and can't find it any longer.
Reply all
Reply to author
Forward
0 new messages