Discuss Scratch

medians
Scratcher
1000+ posts

"Key Pressed" variable

k7e wrote:

medians wrote:

undeterminstic wrote:

what if you click multiple inputs

medians wrote:

sharkode wrote:

No support, what if multiple keys are pressed at the same time?
It could just report a list or sth then.
What use would a block that reports a list have?
It could allow you to do this:
(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

-N6- wrote:

Hi,

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

Wouldn't that be:
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

bababadibot8 wrote:

-N6- wrote:

Hi,

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

Wouldn't that be:
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
I just understood, you mean a reporter for a key that is being pressed currently?
106809nes
Scratcher
1000+ posts

"Key Pressed" variable

bababadibot8 wrote:

-N6- wrote:

Hi,

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

Wouldn't that be:
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
No it'd be more of this:
<key (join [any key here] []) pressed?>

Powered by DjangoBB