how would i go about sending this around, especially in a large library? mark all the relevant blocks and ask the user to set it up by themself? what happens if that broadcast name is already used? i need to explain what "data" is supposed to be for every block? what happens if the user finds out later they don't need the broadcast, will they remember to remove the other code?
this doesn't even have state for the individual block, this is one block that needs to handle all the sprites. what if i want to access the code under the hat and transform it? imagine a custom hat where when the project is loaded, all the blocks under it are transformed and used elsewhere. it would be really nice if some script could grab some other code based on the hat block used over it. currently i don't think any script related blocks can touch hat blocks.
I'm not sure I understand what custom hat block you'd want to use in your example. The relevant event, a key press, has a hat block, which you're using.
the broadcast here is what i'm suggesting would be replaced by a custom hat block. it broadcasts when a key is pressed, but not when it is held. currently, there's no way to put it in a library, it has to be manually created every time.
something like that, but i probably wouldn't name it that if that's what you mean. "recieve" sounds too much like a broadcast, and ideally there wouldn't be any named broadcast, because the names of broadcasts in different libraries could conflict.
the way i would design the ui for a custom hat block is that you would place any number of existing hat blocks in it with any scripts, and you have a variable representing the code under the hat block, which you MAY run, or even just do other things with. it would be similar to running or modifying a continuation.