Make moving (reordering) blocks inside a script less frustrating

Off topic, so open a new topic if this my rant is interesting. :slight_smile: But it's just how you do it in any editor: you have a cursor. If you press a button, it's implied that you wanted to insert there. Only difference is that here instead of "characters" you have blocks, so it's like vertical writing.

1 Like

It is interesting. Should I ask @bh to move this part of conversation to a new thread?

No.

You may search forum or manual for keyboard editing mode.

I've managed to implement it :slight_smile:

vtBAYc5Eda

2 Likes

But why is the How to enable block typing using keyboard? thread in the uncategorized; it should be in idk the Tutorials (Here's how to) category, I guess.

An important point of these visual editors is that you (well, the kids) don't have to type. BUT... off topic, so, @kinestheticlearning please go ahead and move it to its own topic, as you offered.

Wow.

How did you do it? Have you edited the Snap! source code?

I can't (am not a moderator, only moderators can).

Cool, but "extract"? Shouldn't it be "move", or even "move single block"?

Also, how about adding the Ctrl+click shortcut, as it's in Blockly, Arcade, etc. Not everybody will use it for sure, but some will. (More would, if the context menu shows "Ctrl+left" as well.)

Yes - we can run our own versions of Snap! (without cloud login facility) by just downloading the source code and just opening the index.html file with a browser :slight_smile:

(I believe you can get cloud as well but that requires having your webserver AFAIK)

I found the right-click menu code section and just copy/pasted the code for the duplicate entry and then just called the code that deletes a block after making the copy

1 Like

So, you have your own personal copy of Snap! source code? Wow.

I would be too afraid to mess things up, if I tried to edit anything in source code. It seems you are not afraid of messing up things.

That is useful for prototyping just the way you did it now. Do you have any special editor for source code editing?

Can you make a short tutorial and show exactly how you did this prototype?

1 Like

The syntax came from the discussion in the GP forum

and as @tguneysu posted, John (Maloney) has implemented the idea in Microblocks so at the moment, its the de-facto standard :slight_smile:

I'm not tied to the name but the all the action does is "extract" the block from the script - it doesn't move it anywhere in particular (Just like the duplicate blocks - they just make a copy - they don't move/put them anywhere)

"Move" meant to be what you wanted to achieve, and therefore, what you will probably look for in the context menu. But true, it's not strictly what it does. However, you will automatically hold that block after clicking on that menu item, so you will move it together with the mouse pointer. (At least "duplicate" does that.) So it's not a lie either if we call it "move".

One caveat... what's with the touch interface. There you won't hold the block initially. (I never even tried Snap with touch, but I assume so.) Well, you still moved the block out of its original place...

I just used Notepad++ (I'm using Windows)
Every now and then I try playing with specialist code editors but I find them too complex for my simple needs :slight_smile:

Unfortunately, I'm not very good at writing tutorials/documentation :frowning:

Here's what I do:

[scratchblocks]
... a :: grey
block or script to move
... b :: extension
[/scratchblocks]

Drag ... b above block or script to move

[scratchblocks]
... a :: grey
... b :: extension
block or script to move
[/scratchblocks]

Then move block or script to move to where I want it

1 Like

It's like playing "Tower of Hanoi" :wink:

1 Like

Since cymplecy was so quick with the extract idea ( THANKS CYMPLECY), another GREAT feature I like in block IDE's is the "DISABLE BLOCK" feature in MIT App Inventor.
One R-click selects it in the menu and the block turns light grey / beige color and will not be executed in the stream that it is located. Another R-click and "ENABLE BLOCK" activates the block again.
Great debugging tool without messing up the order / sequence of blocks, which is my biggest gripe with long block sequences that are riddled with C-Blocks to boot.

3 Likes

This is a makeshift solution. The project adds "grab this" menu item as described by @cymplecy.
Sprite can be exported and dragged to any other project.
https://snap.berkeley.edu/snap/snap.html#present:Username=dardoro&ProjectName=userMenu.grabThis&editMode&noRun

2 Likes

Do you know about the keyboard editor? Reference Manual page 115.