Discuss Scratch
- Discussion Forums
- » Suggestions
- » Variable input for keyboard key sensors for making customizable controls?
- peekaboo3
-
Scratcher
39 posts
Variable input for keyboard key sensors for making customizable controls?
really
more like
<key [backspace v] pressed?>
more like
when [backspace v] key pressed
- peekaboo3
-
Scratcher
39 posts
Variable input for keyboard key sensors for making customizable controls?
More keys
For example
<key [enter v] pressed?>
For example
when [enter v] key pressed
- peekaboo3
-
Scratcher
39 posts
Variable input for keyboard key sensors for making customizable controls?
???
<key [ v] pressed?>
Last edited by peekaboo3 (May 26, 2015 12:22:29)
- FalconGunner99
-
Scratcher
1000+ posts
Variable input for keyboard key sensors for making customizable controls?
reallyWell if new keys were added there would be both. Also, don't spam.<key [backspace v] pressed?>
more likewhen [backspace v] key pressed
- gamebeater187
-
Scratcher
1000+ posts
Variable input for keyboard key sensors for making customizable controls?
<key [] pressed?>
this is the backspace sensor above.
<key [] pressed?>
this is the delete sensor above.
<key [] pressed?>
this is the either ctrl,alt,or shift sensor above.
<key [ ] pressed?>
this is the tab sensor above.
<key (join [#] []) pressed?>
This is the hashtag sensor above.
- rodrick535
-
Scratcher
12 posts
Variable input for keyboard key sensors for making customizable controls?
Hi! I was just going to let you know I know how to make scratch detect custom keys (I think!)
So first, grab a block that says “Space Key pressed?” then you save the file. (be sure to change “sb2” to “zip”!)
then, go to “Computer” if you use Windows. (try opening your computer database if you use something else.) now, go to downloads, then open the zip file. you will see stuff that might not make sense. now open “project.json” and you will see something like this:
{
“objName”: “Stage”,
“sounds”: [{
“soundName”: “pop”,
“soundID”: 1,
“md5”: “83a9787d4cb6f3b7632b4ddfebf74367.wav”,
“sampleCount”: 258,
“rate”: 11025,
“format”: “”
}],
“costumes”: [{
“costumeName”: “backdrop1”,
“baseLayerID”: 3,
“baseLayerMD5”: “739b5e2a2435f6e1ec2993791b423146.png”,
“bitmapResolution”: 1,
“rotationCenterX”: 240,
“rotationCenterY”: 180
}],
“currentCostumeIndex”: 0,
“penLayerMD5”: “5c81a336fab8be57adc039a8a2b33ca9.png”,
“penLayerID”: 0,
“tempoBPM”: 60,
“videoAlpha”: 0.5,
“children”: [{
“objName”: “Sprite1”,
“scripts”: [[70, 183, []]],
“sounds”: [{
“soundName”: “meow”,
“soundID”: 0,
“md5”: “83c36d806dc92327b9e7049a565c6bff.wav”,
“sampleCount”: 18688,
“rate”: 22050,
“format”: “”
}],
“costumes”: [{
“costumeName”: “costume1”,
“baseLayerID”: 1,
“baseLayerMD5”: “09dc888b0b7df19f70d81588ae73420e.svg”,
“bitmapResolution”: 1,
“rotationCenterX”: 47,
“rotationCenterY”: 55
},
{
“costumeName”: “costume2”,
“baseLayerID”: 2,
“baseLayerMD5”: “3696356a03a8d938318876a593572843.svg”,
“bitmapResolution”: 1,
“rotationCenterX”: 47,
“rotationCenterY”: 55
}],
“currentCostumeIndex”: 0,
“scratchX”: 0,
“scratchY”: 0,
“scale”: 1,
“direction”: 90,
“rotationStyle”: “normal”,
“isDraggable”: false,
“indexInLibrary”: 1,
“visible”: true,
“spriteInfo”: {
}
}],
“info”: {
“hasCloudData”: false,
“userAgent”: “Mozilla\/5.0 (Windows NT 6.1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/48.0.2564.116 Safari\/537.36”,
“scriptCount”: 0,
“swfVersion”: “v444.1”,
“spriteCount”: 1,
“flashVersion”: “WIN 21,0,0,182”,
“videoOn”: false,
“projectID”: “101161134”
}
}
Don't worry, I'll guide you through!
now look for “keyPressed:”, “space”.
change “space” to any other icon. like !, @, or *!
now save the file and quit.
then you find the text file, right-click it, then hover “send to…” then you click “Zipped (Compressed) folder”
then you change “zip” to “sb2”. then open the file.
(Note: this might not work with the website. I tried it, and it failed to load for some reason. try the offline editor.)
So first, grab a block that says “Space Key pressed?” then you save the file. (be sure to change “sb2” to “zip”!)
then, go to “Computer” if you use Windows. (try opening your computer database if you use something else.) now, go to downloads, then open the zip file. you will see stuff that might not make sense. now open “project.json” and you will see something like this:
{
“objName”: “Stage”,
“sounds”: [{
“soundName”: “pop”,
“soundID”: 1,
“md5”: “83a9787d4cb6f3b7632b4ddfebf74367.wav”,
“sampleCount”: 258,
“rate”: 11025,
“format”: “”
}],
“costumes”: [{
“costumeName”: “backdrop1”,
“baseLayerID”: 3,
“baseLayerMD5”: “739b5e2a2435f6e1ec2993791b423146.png”,
“bitmapResolution”: 1,
“rotationCenterX”: 240,
“rotationCenterY”: 180
}],
“currentCostumeIndex”: 0,
“penLayerMD5”: “5c81a336fab8be57adc039a8a2b33ca9.png”,
“penLayerID”: 0,
“tempoBPM”: 60,
“videoAlpha”: 0.5,
“children”: [{
“objName”: “Sprite1”,
“scripts”: [[70, 183, []]],
“sounds”: [{
“soundName”: “meow”,
“soundID”: 0,
“md5”: “83c36d806dc92327b9e7049a565c6bff.wav”,
“sampleCount”: 18688,
“rate”: 22050,
“format”: “”
}],
“costumes”: [{
“costumeName”: “costume1”,
“baseLayerID”: 1,
“baseLayerMD5”: “09dc888b0b7df19f70d81588ae73420e.svg”,
“bitmapResolution”: 1,
“rotationCenterX”: 47,
“rotationCenterY”: 55
},
{
“costumeName”: “costume2”,
“baseLayerID”: 2,
“baseLayerMD5”: “3696356a03a8d938318876a593572843.svg”,
“bitmapResolution”: 1,
“rotationCenterX”: 47,
“rotationCenterY”: 55
}],
“currentCostumeIndex”: 0,
“scratchX”: 0,
“scratchY”: 0,
“scale”: 1,
“direction”: 90,
“rotationStyle”: “normal”,
“isDraggable”: false,
“indexInLibrary”: 1,
“visible”: true,
“spriteInfo”: {
}
}],
“info”: {
“hasCloudData”: false,
“userAgent”: “Mozilla\/5.0 (Windows NT 6.1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/48.0.2564.116 Safari\/537.36”,
“scriptCount”: 0,
“swfVersion”: “v444.1”,
“spriteCount”: 1,
“flashVersion”: “WIN 21,0,0,182”,
“videoOn”: false,
“projectID”: “101161134”
}
}
Don't worry, I'll guide you through!
now look for “keyPressed:”, “space”.
change “space” to any other icon. like !, @, or *!
now save the file and quit.
then you find the text file, right-click it, then hover “send to…” then you click “Zipped (Compressed) folder”
then you change “zip” to “sb2”. then open the file.
(Note: this might not work with the website. I tried it, and it failed to load for some reason. try the offline editor.)
- IgDegOo
-
Scratcher
1000+ posts
Variable input for keyboard key sensors for making customizable controls?
This post is extremely longPlease don't post on old topics. This was from 3 years ago.
- silverCreeper356
-
Scratcher
18 posts
Variable input for keyboard key sensors for making customizable controls?
if you get some hacked blocks then you can get any accent or symbol
when gf clicked
if <key (join [@] (nothing)) pressed> then
add [@] to list
Last edited by silverCreeper356 (April 10, 2016 14:02:51)
- Studio04040807
-
Scratcher
100+ posts
Variable input for keyboard key sensors for making customizable controls?
Support! Also, the workaround for right-clicking is:
when this sprite clickedUnfortunately, this runs the left mouse script when the middle mouse is pressed too, and only works for clicking that sprite, and may not work if the player clicks the mouse very quickly.
if <mouse down?> then
left mouse script
else
right mouse script
- MrFluffyPenguins
-
Scratcher
1000+ posts
Variable input for keyboard key sensors for making customizable controls?
I have the same problem:
This is what I THOUGHT would work:
It just says “true” as the movement.
This is what I THOUGHT would work:
when green flag clicked
forever
set [movement v] to <key [any] pressed?>
end
It just says “true” as the movement.
- aaronsacks2006
-
Scratcher
65 posts
Variable input for keyboard key sensors for making customizable controls?
ok i will try that
Last edited by aaronsacks2006 (Oct. 26, 2018 00:05:17)
- StrangeMagic32
-
Scratcher
1000+ posts
Variable input for keyboard key sensors for making customizable controls?
Support! This is amazing! It would add so much more uses for the keyboard!
(also I learned something
)
(also I learned something
)This topic is still relevant so it is technically not necroposting in a sense (still kinda is, but I think you get the point) As the scratch team and many others have said that they want to keep topics all together so that it's not spread around.This post is extremely longPlease don't post on old topics. This was from 3 years ago.
- BigBrain_Productions
-
Scratcher
28 posts
Variable input for keyboard key sensors for making customizable controls?
Here use this:
ask [Whats the up the control?] and wait
set [ Up] to (answer)
- Discussion Forums
- » Suggestions
-
» Variable input for keyboard key sensors for making customizable controls?










