Discuss Scratch

UltroGmr
Scratcher
56 posts

Support for more keys and right click

There are some scenarios where I wish Scratch had a “on sprite right clicked” block, and support for the shift, enter, tab, and backspace keys on blocks that detect key presses.
This would be very useful for making games like Minecraft where you could right click to place/interact and left click to break. It would also be useful for implementing many other controls in many different types of games. A lot of real games use the shift key and right clicking, so I don't really understand why this hasn't been implemented in Scratch yet? Backspace could also be used as a control to delete things in sandbox projects.
I would also like to see support for using the scroll wheel on your mouse.
<scroll wheel down?>
<key [shift] pressed?>
<right click down?>
when this sprite right clicked
when player scrolls up
when player scrolls down
when [enter] key pressed
<player scrolling up?>
<player scrolling down?>

Last edited by UltroGmr (Oct. 18, 2020 19:11:58)

latin_gamerX
Scratcher
500+ posts

Support for more keys and right click

the scroll wheel is only on some devices so projects that depend on it wouldn't work for most devices and scrolling would be unnecessary

maneksha0583 wrote:

Thank you guys!!! much appreciated, Also, you should try Taco Bell @latin_gamerX
sportfan999
Scratcher
1000+ posts

Support for more keys and right click

Scroll wheel workaround:
when [up arrow v] key pressed
...
when [down arrow v] key pressed
...
Enter key pressed workaround:
when green flag clicked
forever
if <key (join [enter][]) pressed?> then
...
Just saying….

Last edited by sportfan999 (Oct. 18, 2020 19:41:54)


look who's back!
ProgramJpeg
Scratcher
4 posts

Support for more keys and right click

when green flag clicked
if <key (join [key] []) pressed?> then
...
end

works for all keys

Last edited by ProgramJpeg (July 23, 2021 18:52:57)

ScolderCreations
Scratcher
1000+ posts

Support for more keys and right click

I think someone has made these suggestions before.

SonicFanX123_321
Scratcher
1000+ posts

Support for more keys and right click

fun fact! you actually can recreate scrolling using this script:

when [up arrow v] key pressed // scroll up
if <not <key [up arrow v] pressed?>> then
... ::grey
end

when [down arrow v] key pressed // scroll down
if <not <key [down arrow v] pressed?>> then
... ::grey
end

the reason this works is the hat blocks react to scroll wheels and arrow keys (up/down), while the predicate block doesn't (i think i remember seeing this on the Scratch Wiki or something) so by doing that, you now have a scroll wheel

for other keys, support! it'd be really useful for making an OS! i'm pretty sure you can't use backspace right now, but using this script:
<key (join [] [shift]) pressed?>
i'm pretty sure that allows shift detection.
scratch on
edit: bad news: my last script broke! shift detection is no longer possible :c that being said, scratch on

Last edited by SonicFanX123_321 (July 24, 2021 08:53:16)


this is my page

I'm not active on scratch anymore, I moved on.

Powered by DjangoBB