Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I want to know how to make secret keyboard codes
- JayoTophats
-
2 posts
I want to know how to make secret keyboard codes
I'm wanting to add something in a private project where if you type something (e.g. “ilikechocolate”) a secret will play, thank you 

- theforgottenwisp
-
100+ posts
I want to know how to make secret keyboard codes
Maybe this:
when green flag clicked
wait until <key [something v] pressed?> // Use as many of these as you need
wait until <key [something v] pressed?>
wait until <key [something v] pressed?>
wait until <key [something v] pressed?>
wait until <key [something v] pressed?>
... // This happens after the code is typed
Last edited by theforgottenwisp (Nov. 29, 2022 21:14:55)
- sCrAtCh_139508
-
100+ posts
I want to know how to make secret keyboard codes
when green flag clicked
delete all of [codes v] :: list
delete all of [typed v] :: list
add [ilikechocolate] to codes
add [donuts1395] to codes
forever
set [code typed v] to []
wait until <key [any v] pressed ?>
sense type
if <[codes v] contains (code typed) ?> then
broadcast [typed code! v]
end
wait until <not <key [any v] pressed ?>>
end
define add (code) to codes
add (code) to [codes v]
add [] to [typed v]
define sense type
set [Avar v] to [0]
repeat (length of [typed v] :: list)
change [Avar v] by (1)
if <key (letter ((length of (item (Avar) of [typed v] :: list)) + (1)) of (item (Avar) of [codes v] :: list)) pressed ?> then
replace item (Avar) of [typed v] with (join (item (Avar) of [typed v] :: list) (letter ((length of (item (Avar) of [typed v] :: list)) + (1)) of (item (Avar) of [codes v] :: list)))
if <(item (Avar) of [typed v] :: list) = (item (Avar) of [codes v] :: list)> then
set [code typed v] to (item (Avar) of [typed v] :: list)
end
else
replace item (Avar) of [typed v] with []
end
end
- _ninjatuna
-
58 posts
I want to know how to make secret keyboard codes
You can use the Makey Makey extension. (Works only with arrow keys)
- supernavo
-
1000+ posts
I want to know how to make secret keyboard codes
Makey Makey has more options.
when [code goes here like a b c d etc] pressed in order::hat pen //hackedFind it in extensions. That's the little blue square with blocks on it under the palette.
when (join [code goes here like a b c d etc] []) pressed in order::pen hat //normal
when (code) pressed in order::hat pen // code goes in variable
when [up up down down left right left right v] pressed in order::hat pen //limited
Last edited by supernavo (Dec. 2, 2022 13:31:25)
- _ninjatuna
-
58 posts
I want to know how to make secret keyboard codes
Ohh..My bad, i didn't realize that, thanks Makey Makey has more options.when [code goes here like a b c d etc] pressed in order::hat pen //hackedFind it in extensions. That's the little blue square with blocks on it under the palette.
when (join [code goes here like a b c d etc] []) pressed in order::pen hat //normal
when (code) pressed in order::hat pen // code goes in variable
when [up up down down left right left right v] pressed in order::hat pen //limited

- supernavo
-
1000+ posts
I want to know how to make secret keyboard codes
YwOhh..My bad, i didn't realize that, thanks Makey Makey has more options.when [code goes here like a b c d etc] pressed in order::hat pen //hackedFind it in extensions. That's the little blue square with blocks on it under the palette.
when (join [code goes here like a b c d etc] []) pressed in order::pen hat //normal
when (code) pressed in order::hat pen // code goes in variable
when [up up down down left right left right v] pressed in order::hat pen //limited
- Discussion Forums
- » Help with Scripts
-
» I want to know how to make secret keyboard codes