Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » about the key () pressed? block
- 1Draven
-
Scratcher
100+ posts
about the key () pressed? block
How do I check if three keys or four keys are being held down
- GIitchInTheMatrix
-
Scratcher
1000+ posts
about the key () pressed? block
at the same time, few keyboards will allow it.
Separate, put multiple conditionals within the loop or use hat blocks.
Separate, put multiple conditionals within the loop or use hat blocks.
- GIitchInTheMatrix
-
Scratcher
1000+ posts
about the key () pressed? block
most are limited to 2, depends on the hardware how many they can handle.(#2)so only some computers will allow 3 or 4 keys all being held down?
at the same time, few keyboards will allow it.
Separate, put multiple conditionals within the loop or use hat blocks.
- 1Draven
-
Scratcher
100+ posts
about the key () pressed? block
(#4)oh so nintendo switch can handle it but Chromebooks can't? (i know that Nintendo switches can handle it because in the Sans fight if you press all four buttons down on his slam attack you will jump as soon as he slams you into any wall and also gamemaker is in JavaScript from what I know)most are limited to 2, depends on the hardware how many they can handle.(#2)so only some computers will allow 3 or 4 keys all being held down?
at the same time, few keyboards will allow it.
Separate, put multiple conditionals within the loop or use hat blocks.
- 09878901234321
-
Scratcher
500+ posts
about the key () pressed? block
I've never encountered a computer that couldn't handle many keys being pressed. Many computer games simultaneously many have key inputs, with WASD, space, or arrow keys.
I made a project to get all of the keys pressed if that's what you're looking for.
I made a project to get all of the keys pressed if that's what you're looking for.
- 1Draven
-
Scratcher
100+ posts
about the key () pressed? block
(#7)but I'm on a Chromebook and it won't register all the arrow keys being pressed
I've never encountered a computer that couldn't handle many keys being pressed. Many computer games simultaneously many have key inputs, with WASD, space, or arrow keys.
I made a project to get all of the keys pressed if that's what you're looking for.
- 09878901234321
-
Scratcher
500+ posts
about the key () pressed? block
Oh, then it must be a hardware issue. Since the project works completely fine for me on my device, and on multiple browsers.
As an example, here is an image showing all the arrows being pressed simultaneously:

As an example, here is an image showing all the arrows being pressed simultaneously:

Last edited by 09878901234321 (June 5, 2023 20:46:54)
- 1Draven
-
Scratcher
100+ posts
about the key () pressed? block
(#10)well i guess * out of luck then
Oh, then it must be a hardware issue. Since the project works completely fine for me on my device, and on multiple browsers.
As an example, here is an image showing all the arrows being pressed simultaneously:
Last edited by 1Draven (June 5, 2023 20:48:30)
- medians
-
Scratcher
1000+ posts
about the key () pressed? block
You could use the and operator block then, and copy and paste them:(#6)i'm going to assume you meant like pressing any four different keys and no I mean like pressing all four arrow keys
Do you mean any 3 or 4 keys?

Or you could use a list with the keys.
Last edited by medians (June 5, 2023 20:50:22)
- medians
-
Scratcher
1000+ posts
about the key () pressed? block
Yeah you might need another computer or keyboard then:(#7)but I'm on a Chromebook and it won't register all the arrow keys being pressed
I've never encountered a computer that couldn't handle many keys being pressed. Many computer games simultaneously many have key inputs, with WASD, space, or arrow keys.
I made a project to get all of the keys pressed if that's what you're looking for.

- 09878901234321
-
Scratcher
500+ posts
about the key () pressed? block
Test the project if you want: https://scratch.mit.edu/projects/835709331/
Last edited by 09878901234321 (June 5, 2023 21:15:35)
- Discussion Forums
- » Help with Scripts
-
» about the key () pressed? block



