Reduce Clutter in Script Area?

I have a number of "Key Pressed" blocks that are cluttering up the script area.

Is there a way to tuck them out of the way?

image

Put them in a different sprite? It could tell your main sprite what to run.

Yes, that would work. I'll shift them over. (Thanks!)

OK, that worked great. I created a "Control Key" sprite (with a keyboard icon) and put all of the control key scripts in that script area.

image

Now that the control key scripts are neatly tucked away, I would like users to be able access a list of the possible control keys. For the moment, I put a list in a reporter block. Are there other suggestions about the best way to make this type of information available to a user?

Your way is good, but you could also put them in the project notes (first thing in the File menu).

Thanks for the suggestion.

image

You can also group these scripts into one script like:
image
or
image

That's a good idea. The various control keys could probably also be consolidated into a single block. An association table might also offer a way to link key combinations to actions.

image

When a key is pressed, the result is captured as "key":

image

This result can then be used to look up the desired action in a association table:

image

I like it.

Is there any difference between the new primitive block you have used (which is available since 7.0 version of the Snap!) on one hand, and the custom "key name pressed?" block which used an 'up-var' and which Jens showed on facebook on March 18th to make a typewriter, on the other hand?

I'm not sure ... I just used this method because it was a new feature of Snap! 7.0 that I thought might be interesting to explore.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.