Discuss Scratch
- Discussion Forums
- » Suggestions
- » Key pressed block
- penguin54
-
Scratcher
17 posts
Key pressed block
At the moment I am trying to make a basic piano program using the keyboard keys to act as the notes but the script can get really long when using the basic













if <key [a] pressed?> thenmethod so I thought: what if there was a KEY PRESSED block which would output the current key that is being pressed as it would make a lot of scripts shorter!
set [keypressed] to [a]
end













<keypressed>
- ChocolatePi
-
Scratcher
1000+ posts
Key pressed block
At the moment I am trying to make a basic piano program using the keyboard keys to act as the notes but the script can get really long when using the basicsounds cool!if <key [a] pressed?> thenmethod so I thought: what if there was a KEY PRESSED block which would output the current key that is being pressed as it would make a lot of scripts shorter!
set [keypressed] to [a]
end
<keypressed>
support
- penguin54
-
Scratcher
17 posts
Key pressed block
What if you are pressing ≥2 keys at once?That is true. Well, it could work by outputting the first key pressed?
- Langdon35
-
Scratcher
500+ posts
Key pressed block
Support!
Support
support!
Sure! Support
At the moment I am trying to make a basic piano program using the keyboard keys to act as the notes but the script can get really long when using the basicsounds cool!if <key [a] pressed?> thenmethod so I thought: what if there was a KEY PRESSED block which would output the current key that is being pressed as it would make a lot of scripts shorter!
set [keypressed] to [a]
end
<keypressed>
support
- QuoStrike
-
Scratcher
32 posts
Key pressed block
I do support, though, I could make a custom block for you guys and post it in a project. All you would have to do is to slide it into your backpack slide it to your project, then make a keypressed variable. I figure you could use that instead.
- VoltageGames
-
Scratcher
1000+ posts
Key pressed block
Support if it allows TAB, ENTER, SHIFT and BACKSPACE/DELETE, but it might confuse new scratchers with the input.
Shift + Click
Shift + Click
<key [ v] pressed?>to get this new block, and Shift + Click to go back.
- penguin54
-
Scratcher
17 posts
Key pressed block
I do support, though, I could make a custom block for you guys and post it in a project. All you would have to do is to slide it into your backpack slide it to your project, then make a keypressed variable. I figure you could use that instead.Thanks! Sounds cool!
- Discussion Forums
- » Suggestions
-
» Key pressed block









