Discuss Scratch

hoppingcoin404
Scratcher
100+ posts

Key Held Length

To put it simply, this block returns the number of seconds a certain key was pressed for.
(length key (space v) held for :: sensing) // resets when key released
<key (space v) held for (1) seconds? :: sensing> // true if the key is held for more than 1 second
samuelthedude
Scratcher
500+ posts

Key Held Length

Can you just do

if <key [space v] pressed?> then
wait (1) secs
if <key [space v] pressed?> then
do things
end
end
hoppingcoin404
Scratcher
100+ posts

Key Held Length

samuelthedude wrote:

Can you just do

if <key [space v] pressed?> then
wait (1) secs
if <key [space v] pressed?> then
do things
end
end
That doesn't work
hoppingcoin404
Scratcher
100+ posts

Key Held Length

bump
hoppingcoin404
Scratcher
100+ posts

Key Held Length

bump
_Paymer
Scratcher
500+ posts

Key Held Length

Support,

For a reason
hoppingcoin404
Scratcher
100+ posts

Key Held Length

bump
hoppingcoin404
Scratcher
100+ posts

Key Held Length

bump
unisparks8
Scratcher
1000+ posts

Key Held Length

1+. I need this.
hoppingcoin404
Scratcher
100+ posts

Key Held Length

bump
hoppingcoin404
Scratcher
100+ posts

Key Held Length

bump
hoppingcoin404
Scratcher
100+ posts

Key Held Length

bump
hoppingcoin404
Scratcher
100+ posts

Key Held Length

bump
hoppingcoin404
Scratcher
100+ posts

Key Held Length

bump
0_009
Scratcher
1000+ posts

Key Held Length

Why do I feel like this is a dupe…
TimothyLawyer
Scratcher
1000+ posts

Key Held Length

Why do you need this?

when [space v] key pressed
reset timer
wait until <not <key [space v] pressed?>>
set [time key pressed v] to (timer)
hoppingcoin404
Scratcher
100+ posts

Key Held Length

TimothyLawyer wrote:

Why do you need this?

when [space v] key pressed
reset timer
wait until <not <key [space v] pressed?>>
set [time key pressed v] to (timer)
That workaround doesn't work properly
TimothyLawyer
Scratcher
1000+ posts

Key Held Length

hoppingcoin404 wrote:

That workaround doesn't work properly
It works to get the length of time a key is pressed.

<(time key pressed) > [1]> // true if the key is held for more than 1 second
or

<not <(time key pressed) < [1]>> // true if the key is held for 1 second or more
hoppingcoin404
Scratcher
100+ posts

Key Held Length

TimothyLawyer wrote:

hoppingcoin404 wrote:

That workaround doesn't work properly
It works to get the length of time a key is pressed.

<(time key pressed) > [1]> // true if the key is held for more than 1 second
or

<not <(time key pressed) < [1]>> // true if the key is held for 1 second or more
The workaround doesn't work like the intended suggestion
hoppingcoin404
Scratcher
100+ posts

Key Held Length

bump

Powered by DjangoBB