Discuss Scratch

ItsDaBeans
Scratcher
53 posts

Scratch 3.0 Special Key Detection

Hi, im trying to make a platformer, and i kind of want a hold shift to sprint king of thing, and Ive looked, but since scratch 3.0 came out, none of the special key detectors work anymore, so i was wondering, is there still a way to get that in Scratch 3.0? I will give credit.

Summary(for lazy peeps) : I need this :
<key [ shift v] pressed?>
ItsDaBeans
Scratcher
53 posts

Scratch 3.0 Special Key Detection

bump
Abhigyaan
Scratcher
20 posts

Scratch 3.0 Special Key Detection

<key [ ItsDaBeans] pressed?>
- Must needed
-Oltimate-
Scratcher
62 posts

Scratch 3.0 Special Key Detection

ItsDaBeans wrote:

Hi, im trying to make a platformer, and i kind of want a hold shift to sprint king of thing, and Ive looked, but since scratch 3.0 came out, none of the special key detectors work anymore, so i was wondering, is there still a way to get that in Scratch 3.0? I will give credit.

Summary(for lazy peeps) : I need this :
<key [ shift v] pressed?>

You can't get that because Scratch 3 took away hacked blocks.


^ Check these out ^

SIGNED:
-Oltimate-
-Snipet-
Scratcher
500+ posts

Scratch 3.0 Special Key Detection

You can do stuff like:
<key (join [] [#])  pressed?>
To see if the “#” key was pressed.

But you can’t do:
<key (join [] [shift])  pressed?>

website =)
Blasted little 60 second rule…
imfh
Scratcher
1000+ posts

Scratch 3.0 Special Key Detection

As of Scratch 3.0, putting stuff in key pressed? does not require hacks, like -Snipet- said. You can freely put blocks at will into it.

It used to be that the ascii character 128 would trigger when special keys like shift were pressed, but it isn't like that anymore. When any key pressed also no longer triggers for special keys.

In summary, I don't think it is possible to detect shift being pressed in the way the op wants.

Scratch to Pygame converter: https://scratch.mit.edu/discuss/topic/600562/
ItsDaBeans
Scratcher
53 posts

Scratch 3.0 Special Key Detection

REPLYING TO EVERYONE



oh.
Scratch_Dad723
Scratcher
3 posts

Scratch 3.0 Special Key Detection

<key pressed?>

Last edited by Scratch_Dad723 (April 18, 2019 01:06:49)

codeman1044
Scratcher
1000+ posts

Scratch 3.0 Special Key Detection

Please do not necropost, as it brings old and resolved topics to the front page, and can hide threads that are in need of answer. Check the date before you post anything.

This is my signature, which shows up every time I post and is automatic. To make a signature of your own, locate the “Change your signature” option in the bottom left of the Discussion Home.
I am nothing if not consistently inconsistent.
Snap! is a website that offers block coding like Scratch, but also offers the creation of your own blocks and writing JavaScript functions. The adventurous should consider checking it out!
Potentially useful tutorials and topic coverage
If you want to see a new tutorial added to this, feel free to leave a suggestion on my profile.
I_haxx
Scratcher
2 posts

Scratch 3.0 Special Key Detection

ItsDaBeans wrote:

Hi, im trying to make a platformer, and i kind of want a hold shift to sprint king of thing, and Ive looked, but since scratch 3.0 came out, none of the special key detectors work anymore, so i was wondering, is there still a way to get that in Scratch 3.0? I will give credit.

Summary(for lazy peeps) : I need this :
<key [ shift v] pressed?>

Well, I haven't found out how to use the shift key, I'm still working on it though. Maybe some of my other projects would help you. Right click, Scrolling engine, etc.

But this would be nice:
<key [ Shift] pressed?>
I_haxx
Scratcher
2 posts

Scratch 3.0 Special Key Detection

The thing is, scratch can detect the shift key, when you scroll and hold shift, it scrolls left and right. If you are reading this scratch team, please, I beg you, add in a if shift key pressed.
codeman1044
Scratcher
1000+ posts

Scratch 3.0 Special Key Detection

A) Please don't necropost. This brings old topics to the front page.
B) If you want to make a suggestion, go to the Suggestions forum: https://scratch.mit.edu/discuss/1/

This is my signature, which shows up every time I post and is automatic. To make a signature of your own, locate the “Change your signature” option in the bottom left of the Discussion Home.
I am nothing if not consistently inconsistent.
Snap! is a website that offers block coding like Scratch, but also offers the creation of your own blocks and writing JavaScript functions. The adventurous should consider checking it out!
Potentially useful tutorials and topic coverage
If you want to see a new tutorial added to this, feel free to leave a suggestion on my profile.
UserTECH
Scratcher
3 posts

Scratch 3.0 Special Key Detection

EVERYONE!!! I have firgured it out!
You can do

set [key] to [enter]
Then do
when green flag clicked
forever
if <key [ key] pressed?> then
broadcast [ do stuff]
end
end
This actually works! I figured it out
I am still testing with other keys, come back soon with more
sadly no shift key…
scratch doesn't have shift detection in its coding

Last edited by UserTECH (Oct. 3, 2019 21:54:46)

codeman1044
Scratcher
1000+ posts

Scratch 3.0 Special Key Detection

UserTECH wrote:

EVERYONE!!! I have firgured it out!
You can do

set [key] to [enter]
Then do
when green flag clicked
forever
if <key [ key] pressed?> then
broadcast [ do stuff]
end
end
This actually works! I figured it out
I am still testing with other keys, come back soon with more
sadly no shift key…
scratch doesn't have shift detection in its coding
This works more efficiently, as you don't need a variable to make it work:
<key (join [enter] ()) pressed?> 

This is my signature, which shows up every time I post and is automatic. To make a signature of your own, locate the “Change your signature” option in the bottom left of the Discussion Home.
I am nothing if not consistently inconsistent.
Snap! is a website that offers block coding like Scratch, but also offers the creation of your own blocks and writing JavaScript functions. The adventurous should consider checking it out!
Potentially useful tutorials and topic coverage
If you want to see a new tutorial added to this, feel free to leave a suggestion on my profile.
UserTECH
Scratcher
3 posts

Scratch 3.0 Special Key Detection

Hmm… didn't think of that one, that seems much more efficent

Powered by DjangoBB