Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How To Press Two Keys at the Same Time
- CursedWonton
-
5 posts
How To Press Two Keys at the Same Time
Hello, I'm new to Scratch. I have a problem I haven't been able to find help with. I was wondering how you could press two keys at the same time and have it work correctly. For example, when you want to jump up and go left at the same time, how do you do that without having to press the keys one at a time? It just seems like it would be more convenient to have the sprite doing two things at once without having to stall in between pressing buttons.
- asivi
-
1000+ posts
How To Press Two Keys at the Same Time
Hi, if you have your movement's script (including jump) inside a forever loop, take out the jump and use
- Camo-Dude
-
500+ posts
How To Press Two Keys at the Same Time
There are different ways in which you can do this but it depends on how you want it so i will give you script for both ways
if you want it where they can jump but must press the left keys multiple times to keep moving left use this
However if you want smooth left movement use
if you want it where they can jump but must press the left keys multiple times to keep moving left use this
However if you want smooth left movement use
- CursedWonton
-
5 posts
How To Press Two Keys at the Same Time
Thank you all for your help, I appreciate it!
- AwesomeCreator9875
-
100+ posts
How To Press Two Keys at the Same Time
You can use broadcasting too!
Last edited by AwesomeCreator9875 (Sept. 13, 2016 15:35:15)
- pillOfCode
-
1 post
How To Press Two Keys at the Same Time
i have trouble too with this and none of the examples are working 

- pengoo49
-
2 posts
How To Press Two Keys at the Same Time
How about this?
Last edited by pengoo49 (Oct. 6, 2017 21:32:30)
- charlottelucy15
-
100+ posts
How To Press Two Keys at the Same Time
That could work actually. I can test the script to see if it works. How about this?
- awesome5185
-
1000+ posts
How To Press Two Keys at the Same Time
That won't work smoothly. The forever script runs better. Hi, if you have your movement's script (including jump) inside a forever loop, take out the jump and use
This will make it so you can hold both keys at a time and have it go diagonal, although technically it's not, it's moving too fast for you to see anyway.
- TG_Zero
-
2 posts
How To Press Two Keys at the Same Time

Last edited by TG_Zero (April 16, 2018 18:39:46)
- ChefBoyardee117
-
1 post
How To Press Two Keys at the Same Time
oy oy thanks for the help my dudes
- TheCodePro123
-
100+ posts
How To Press Two Keys at the Same Time
Here's the best idea that can be done.
- StrangeMagic32
-
1000+ posts
How To Press Two Keys at the Same Time
please make your own topic. Thanks! but nothing works.
you are more likely to get an answer that way.
Last edited by StrangeMagic32 (April 18, 2019 22:29:02)
- tanish-vaidya
-
3 posts
How To Press Two Keys at the Same Time
THIS IS A PROBLEM I'M FACING
What if you have a condition for example, if black color touched then stop doing this action and do this action. With one key pressed it works fine, but when i tried adding two keys to move the tank diagonally, the tank moved fine, until it touched black, when it did so it would surpass them. To see my problem I'm putting the link to my game, if you find the right code please remix it and send the link to me by replying to this post. Thank you. ^_^
The link is - https://scratch.mit.edu/projects/274450571/
What if you have a condition for example, if black color touched then stop doing this action and do this action. With one key pressed it works fine, but when i tried adding two keys to move the tank diagonally, the tank moved fine, until it touched black, when it did so it would surpass them. To see my problem I'm putting the link to my game, if you find the right code please remix it and send the link to me by replying to this post. Thank you. ^_^
The link is - https://scratch.mit.edu/projects/274450571/
Last edited by tanish-vaidya (Aug. 12, 2019 03:52:42)
- ResExsention
-
1000+ posts
How To Press Two Keys at the Same Time
THIS IS A PROBLEM I'M FACING
What if you have a condition for example, if black color touched then stop doing this action and do this action. With one key pressed it works fine, but when i tried adding two keys to move the tank diagonally, the tank moved fine, until it touched black, when it did so it would surpass them. To see my problem I'm putting the link to my game, if you find the right code please remix it and send the link to me by replying to this post. Thank you. ^_^
The link is - https://scratch.mit.edu/projects/274450571/
Please make your own topic. The last reply was from 2018, so your post is considered a “necropost”.
Sorry about that…
- codeman1044
-
1000+ posts
How To Press Two Keys at the Same Time
Please don't spam or necropost.
- Discussion Forums
- » Help with Scripts
-
» How To Press Two Keys at the Same Time