Shift-click to edit block

https://snap.berkeley.edu/snap/snap.html#present:Username=cst1229&ProjectName=Shift-click%20to%20edit%20block&editMode&noRun

Allows you to shift-click a custom block to quickly open the edit window for it. This means you cannot enter the keyboard editor with the mouse when clicking on custom blocks, but I don't think many people use that.

Here's the code, if you want to make a userscript or something:

if (!CustomCommandBlockMorph.prototype.originalMouseClickLeft) {
    CustomCommandBlockMorph.prototype.originalMouseClickLeft = CustomCommandBlockMorph.prototype.mouseClickLeft;
}
CustomCommandBlockMorph.prototype.mouseClickLeft = function() {
    if (this.world().currentKey === 16) {
        this.edit();
    } else {
        this.originalMouseClickLeft(...arguments);
    }
}
if (!CustomReporterBlockMorph.prototype.originalMouseClickLeft) {
    CustomReporterBlockMorph.prototype.originalMouseClickLeft = CustomReporterBlockMorph.prototype.mouseClickLeft;
}
CustomReporterBlockMorph.prototype.mouseClickLeft = CustomCommandBlockMorph.prototype.mouseClickLeft;

Great! This will be useful to me :slightly_smiling_face:

I was thinking alt+click would be better. Not sure if every keyboard has the key though.

Oh wait that.
I used shift because I was going to implement it using Morphic features I think, which doesn't support Alt. But since we're using direct keycode detection...

You can already detect alt using the key pressed block, so it's definitely already possible.

Oh it does! Alt-click the stage size toggle, you'll see.

Wait, what does it do? I can't test it right now because I'm on mobile.

It makes the stage double-size without going into presentation mode.

Oh, never knew that.