Discuss Scratch
- medians
-
Scratcher
1000+ posts
"Key Pressed" variable
It could allow you to do this:What use would a block that reports a list have?what if you click multiple inputsNo support, what if multiple keys are pressed at the same time?It could just report a list or sth then.
(item (1 v) of (keys pressed ::sensing) :: list)
- Zyaxis_Lotl
-
Scratcher
100+ posts
"Key Pressed" variable
this is a good idea it will be useful i support it
- bababadibot8
-
Scratcher
100+ posts
"Key Pressed" variable
Hi,Wouldn't that be:
Please could you add a variable block for when a key is pressed (to keep scratchers from drawing out loads of different if-statements)?
E.g.when green flag clicked
forever
if <key [any v] pressed?> then
add <key pressed> to [text v]
end
end
when green flag clicked
forever
if <key [insert your key here v] pressed?> then
add <key [copy from the first key pressed boolean v] pressed?> to [list v]
end
end
- bababadibot8
-
Scratcher
100+ posts
"Key Pressed" variable
I just understood, you mean a reporter for a key that is being pressed currently?Hi,Wouldn't that be:
Please could you add a variable block for when a key is pressed (to keep scratchers from drawing out loads of different if-statements)?
E.g.when green flag clicked
forever
if <key [any v] pressed?> then
add <key pressed> to [text v]
end
endwhen green flag clicked
forever
if <key [insert your key here v] pressed?> then
add <key [copy from the first key pressed boolean v] pressed?> to [list v]
end
end
- 106809nes
-
Scratcher
1000+ posts
"Key Pressed" variable
No it'd be more of this:Hi,Wouldn't that be:
Please could you add a variable block for when a key is pressed (to keep scratchers from drawing out loads of different if-statements)?
E.g.when green flag clicked
forever
if <key [any v] pressed?> then
add <key pressed> to [text v]
end
endwhen green flag clicked
forever
if <key [insert your key here v] pressed?> then
add <key [copy from the first key pressed boolean v] pressed?> to [list v]
end
end
<key (join [any key here] []) pressed?>



