Discuss Scratch

scratchdoggyuser
Scratcher
76 posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

Hi! I am posting today to ask a question to the wonderful scratch community!

I have created a clicker, and it either triggers when the space bar is pressed, or the button on the screen is pressed.
(Here's my clicker: https://scratch.mit.edu/projects/471567683)

Whenever you hold down on the space bar, though, it acts like an auto-clicker and continues clicking repeatedly.

I was wondering if anyone could help me fix this problem!

Thanks.
TeddyBear_Grills
Scratcher
4 posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

when you take your finger off the space bar, does it stop auto clicking?
scratchdoggyuser
Scratcher
76 posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

Yes, it does, but what I want to happen is:
Every time the space bar is clicked, only add ONE click.

Thanks for replying so quick, and if you have a solution, please reach out
STALKER_Bandit
Scratcher
100+ posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

scratchdoggyuser wrote:

Hi! I am posting today to ask a question to the wonderful scratch community!

I have created a clicker, and it either triggers when the space bar is pressed, or the button on the screen is pressed.
(Here's my clicker: https://scratch.mit.edu/projects/471567683)

Whenever you hold down on the space bar, though, it acts like an auto-clicker and continues clicking repeatedly.

I was wondering if anyone could help me fix this problem!

Thanks.
Try doing this,
when [space v] key pressed
change [points v] by (1)
wait (1) secs
scratchdoggyuser
Scratcher
76 posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

Thanks! I'll try that, but then if the user manages to click the space bar more than once in a second, it wouldn't work..
Would there be any other possible solution?
TeddyBear_Grills
Scratcher
4 posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

That doesn't work mate, if you hold down the space bar it will continue to auto-click just with a one second delay between clicks
dimitrip
Scratcher
500+ posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

scratchdoggyuser wrote:

Thanks! I'll try that, but then if the user manages to click the space bar more than once in a second, it wouldn't work..
Would there be any other possible solution?

scratchdoggyuser wrote:

Thanks! I'll try that, but then if the user manages to click the space bar more than once in a second, it wouldn't work..
Would there be any other possible solution?

Hi.

…sure. This seems to do the job.

Greetz,

Dimitri
scratchdoggyuser
Scratcher
76 posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

Thank you so much! I will surely give you credit in my project!
Sophia09le
New Scratcher
2 posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

I have pressed 125 times space bar in just 5 seconds. I hope you will visit spacebar counter tool and break my record. For visit click spacebar counter
91090
Scratcher
2 posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

STALKER_Bandit wrote:

scratchdoggyuser wrote:

Hi! I am posting today to ask a question to the wonderful scratch community!

I have created a clicker, and it either triggers when the space bar is pressed, or the button on the screen is pressed.
(Here's my clicker: https://scratch.mit.edu/projects/471567683)

Whenever you hold down on the space bar, though, it acts like an auto-clicker and continues clicking repeatedly.

I was wondering if anyone could help me fix this problem!

Thanks.
Try doing this,
when [space v] key pressed
change [points v] by (1)
wait (1) secs

THANK YOU SO MUCH I WAS USING BROADCAST BLOCKS AND THEY WERE DOING THE SAME THING XD
Koamodo975
Scratcher
1000+ posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

91090 wrote:

THANK YOU SO MUCH I WAS USING BROADCAST BLOCKS AND THEY WERE DOING THE SAME THING XD
Please don't necropost.
PilotBear
Scratcher
7 posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?


STALKER_Bandit wrote:

Try doing this,
when [space v] key pressed
change [points v] by (1)
wait (1) secs
Often people click more than once a second meaning this method would be considered slow.
Why don't you use:
when [space] key pressed
change [points] by (1)
wait until <not <key [space] pressed?>>
Arnoshadzu1
Scratcher
1 post

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

but what if i want a cooldown between the presses
missingmodel821
Scratcher
100+ posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

Arnoshadzu1 wrote:

but what if i want a cooldown between the presses
Please don't necropost.
awesome-llama
Scratcher
1000+ posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

Arnoshadzu1 wrote:

but what if i want a cooldown between the presses
You can use the timer to measure the time since last press:

when [space v] key pressed
if <(timer) > [0.5]> then // cooldown of 0.5 seconds
change [points v] by (1)
reset timer
wait until <not <key [space v] pressed?>>
end

The wait until block in the example can modified depending on the behaviour desired.
The current example being inside means the key must be released if the points were increased, still allowing for someone to hold the key until the cooldown is done. If outside, the key must always be released. It could also be removed entirely if you just want to hold the key and have the points change every time the cooldown is done.
PAYstudios
Scratcher
12 posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

here is it

when green flag clicked
forever
if <key [space v] pressed?> then
change [score v] by (1)
wait until <not <key [space v] pressed?>>
end
end

Last edited by PAYstudios (June 21, 2025 13:41:53)

cosmosaura
Scratch Team
1000+ posts

When creating a clicker triggered using a space bar, how do you get it to not act like an auto-clicker?

Topic closed due to necroposting.

Powered by DjangoBB