Discuss Scratch

Thepuzzlegame
Scratcher
1000+ posts

Key pressed reporter block

I think there should be a reporter block which reports the name of the key being pressed. This would be incredibly useful and although it is workaroundable the workaround is extremely large and inconvenient and the whole point of scratch is to be simple and easy to use. Some uses of this block can be seen below:

add [a] to [keys v]
add [b] to [keys v]
add [c] to [keys v]
add [d] to [keys v]
add [e] to [keys v]
...
if <[keys v] contains (key pressed::sensing)> then
say [You pressed a key!] for (2) secs
end

say [Press a key!]
wait until <[keys v] contains (key pressed::sensing)>
say (join (join [You pressed the] (key pressed::sensing)) [key!]) for (2) secs

go to x: (-220) y: (160)
forever
if <[keys v] contains (key pressed::sensing)> then
if <(x position)> [220]> then
change y by (-10)
set x to (-220)
else
change x by (6)
end
switch costume to (key pressed::sensing)
stamp
end
end

Last edited by Thepuzzlegame (July 21, 2014 21:51:08)

Iditaroid
Scratcher
500+ posts

Key pressed reporter block

What you're thinking of isn't a boolean, but a reporter.
Thepuzzlegame
Scratcher
1000+ posts

Key pressed reporter block

Iditaroid wrote:

What you're thinking of isn't a boolean, but a reporter.
Thanks for the heads up! Changed the title of the post
Mr_sprite
Scratcher
82 posts

Key pressed reporter block

I totally agree and support this!
Iditaroid
Scratcher
500+ posts

Key pressed reporter block

Thepuzzlegame wrote:

Iditaroid wrote:

What you're thinking of isn't a boolean, but a reporter.
Thanks for the heads up! Changed the title of the post
mathfreak231
Scratcher
1000+ posts

Key pressed reporter block

The one problem with this block is this: What if more than one key was being pressed?

I would support otherwise. Also, I know this has been suggested before, I'm just too lazy to find the link.
Thepuzzlegame
Scratcher
1000+ posts

Key pressed reporter block

mathfreak231 wrote:

The one problem with this block is this: What if more than one key was being pressed?

I would support otherwise. Also, I know this has been suggested before, I'm just too lazy to find the link.
I think the reporter should only report the last key being pressed
MushroomMan99
Scratcher
100+ posts

Key pressed reporter block

Support
stickfiregames
Scratcher
1000+ posts

Key pressed reporter block

How would it report non-printing keys like enter or backspace? Because they have different names in different languages.

Last edited by stickfiregames (July 25, 2014 11:24:55)

robosnakejr
Scratcher
1000+ posts

Key pressed reporter block

stickfiregames wrote:

How would it report non-printing keys like enter or backspace? Because they have different names in different languages.
scratch doesn't (and never will) use those keys.
also, support.
stickfiregames
Scratcher
1000+ posts

Key pressed reporter block

robosnakejr wrote:

stickfiregames wrote:

How would it report non-printing keys like enter or backspace? Because they have different names in different languages.
scratch doesn't (and never will) use those keys.
also, support.
It already does use arrow keys. They have names and do not print.
robosnakejr
Scratcher
1000+ posts

Key pressed reporter block

stickfiregames wrote:

robosnakejr wrote:

stickfiregames wrote:

How would it report non-printing keys like enter or backspace? Because they have different names in different languages.
scratch doesn't (and never will) use those keys.
also, support.
It already does use arrow keys. They have names and do not print.
up
down
left
right
Braeden5454
Scratcher
500+ posts

Key pressed reporter block

I support.
derpmeup
Scratcher
1000+ posts

Key pressed reporter block

robosnakejr wrote:

stickfiregames wrote:

How would it report non-printing keys like enter or backspace? Because they have different names in different languages.
scratch doesn't (and never will) use those keys.
also, support.
It's possible to put those into the key pressed block, though. Griffpatch made an example of that. ;)
Centrifugal
Scratcher
500+ posts

Key pressed reporter block

+Support
Braeden5454
Scratcher
500+ posts

Key pressed reporter block

Just like the one in the dream mod.
TheMasterKing107
Scratcher
36 posts

Key pressed reporter block

Huge support. If two keys were being pressed at once, I believe it would record the last one. And if you actually needed more than 1 key at once, like a caps lock system, do the following:
When [InsertKeyThatTriggersCapLockHere v] pressed::hat control
if <(caps lock) = [on]
set [caps lock v] to [off]
else
set [caps lock v] to [on]
end

if <(caps lock) = [on]
add (<key pressed::sensing>+(LeghtOfAlphabet) ) to [output v]
else
add (key pressed::sensing) to [output v]
end
//or this is another way to deal with two keys at once, the old way
if <<[up v] key pressed::sensing> and <[down v] key pressed::sensing
...

Last edited by TheMasterKing107 (Sept. 8, 2015 00:47:56)

rollercoasterfan
Scratcher
1000+ posts

Key pressed reporter block

Support.
DaSpudLord
Scratcher
1000+ posts

Key pressed reporter block

mathfreak231 wrote:

The one problem with this block is this: What if more than one key was being pressed?

I would support otherwise. Also, I know this has been suggested before, I'm just too lazy to find the link.
Everything I was going to say… and someone beat me to it.

Anyway, semi-support.

Last edited by DaSpudLord (Sept. 8, 2015 00:41:55)

IronBit_Studios
Scratcher
1000+ posts

Key pressed reporter block

robosnakejr wrote:

stickfiregames wrote:

robosnakejr wrote:

stickfiregames wrote:

How would it report non-printing keys like enter or backspace? Because they have different names in different languages.
scratch doesn't (and never will) use those keys.
also, support.
It already does use arrow keys. They have names and do not print.
up
down
left
right
What about languages?
Semi Support.

Powered by DjangoBB