Below is how to implement Righ-Clicking into your Scratch project: Unfortunately, you can't do this without Turbowarp, because there is just no way to use Custom Extensions like the one in this tutorial unless you have Turbowarp. However, you can also use unblocked alternatives like SnailIDE or PenguinMod. To use this extension, simply press the Extension button in the bottom-left of the Turbowarp editor and search for the "Custom Extension" Extension. It should be green with these symbols: {} .Then, you will be presented a UI screen. Click on the "Text" tab copy and paste the Javascript code in the Notes and Credits. (Make sure to toggle the check box, "Run Extension Without Sandbox" or else the extension won't work.) Hit the load button after, and it will create a block that says "Is Right Mouse Button Down" that can be found in a new Custom Block Type section This block basically just functions as a "Is Mouse Down" block but instead for the Right Click Button. You can try it out, and it should work! If it doesn't, comment the problem and I will try to fix it. And yes, this script was made by me, so please leave a like, favorite, follow, and check out some of my other projects. Enjoy! Tags: (Ignore these) #rightclick #right #click #tutorial #games #all #scratch #scratch3
Here is the Javascript for the Custom Extension: (Make sure to read the Instructions first and copy this script all the way to the bottom of the Notes and Credits) Custom Script: (Don't Copy this Line) (function(Scratch) { 'use strict'; class RightClickExtension { constructor() { this.rightMouseDown = false; // Listen for the contextmenu event to detect right clicks // and prevent the default browser menu from appearing document.addEventListener('contextmenu', (e) => { e.preventDefault(); }); // Track mouse button states document.addEventListener('mousedown', (e) => { if (e.button === 2) this.rightMouseDown = true; }); document.addEventListener('mouseup', (e) => { if (e.button === 2) this.rightMouseDown = false; }); } getInfo() { return { id: 'rightclickdetector', name: 'Right Click', blocks: [ { opcode: 'isRightClickDown', blockType: Scratch.BlockType.BOOLEAN, text: 'right mouse down?' } ] }; } isRightClickDown() { return this.rightMouseDown; } } Scratch.extensions.register(new RightClickExtension()); })(Scratch); [/scratchblocks] [/scratchblocks]