Discuss Scratch

Cubey_Dudey
Scratcher
100+ posts

More keyboard blocks

In a game I'm making I wanted to add a feature where you can change the controls and I would find it alot easier with these 2 blocks.
First up a “when key (any) is pressed” would be useful so I know if they pressed anything. I could make the code to wait for any key to be pressed before changing the key.
<key [any v] pressed?>
Also a “last key press” could be useful with the same script, I would say wait until any key is pressed and set the control to that key.
(last key press)

A simplified version of the code I would use it in would look like this:
when I receive [change control v]
wait until <key [any v] pressed?>
set [control v] to (last key press)

Last edited by Cubey_Dudey (April 20, 2023 06:00:19)

-RabbitWorld-
Scratcher
1000+ posts

More keyboard blocks

These blocks you've suggested could be very useful in a bunch of different types of projects. Support!
kkidslogin
Scratcher
1000+ posts

More keyboard blocks

key ,any> presssed

already exists.

Last key pressed can be worked around (Albeit it is clunky), and there is a turbowarp block for that, but I would like to see something like this.
medians
Scratcher
1000+ posts

More keyboard blocks

Uhm…

Edit:
https://scratch.mit.edu/discuss/topic/151492/

Last edited by medians (April 20, 2023 13:04:11)

Knightbot63
Scratcher
1000+ posts

More keyboard blocks

key any press already exists.
And last key pressed may be a duplicate but I tried searching but ocular's down.
medians
Scratcher
1000+ posts

More keyboard blocks

Knightbot63 wrote:

key any press already exists.
And last key pressed may be a duplicate but I tried searching but ocular's down.
I found this:
https://scratch.mit.edu/discuss/topic/151492/
GIitchInTheMatrix
Scratcher
1000+ posts

More keyboard blocks

Knightbot63 wrote:

key any press already exists.
And last key pressed may be a duplicate but I tried searching but ocular's down.
back in the ye old days, when we used google, such peasantry to which we had done
Knightbot63
Scratcher
1000+ posts

More keyboard blocks

medians wrote:

(#6)
I found this:
https://scratch.mit.edu/discuss/topic/151492/
Then that's the duplicate I assume.

Powered by DjangoBB