Key pressed not working properly
id: 679477
category: Help with Scripts
posts: 6
ajlim0403
loading
I am making a keyboard project where if you click a key, it will light up on the project: https://scratch.mit.edu/projects/838004515/
However, if you click buttons like A, it will also light up alt and shift. T does this with tab and shift. When I tried the following code:
However, if you click buttons like A, it will also light up alt and shift. T does this with tab and shift. When I tried the following code:
<key (join [alt] []) pressed?>where the alt is in a variable called “#”. If I click the A key, it will say true for the code above. Please help. All key detection is on the custom block:
define Tick <keyPressed>
NMario84
loading
It is because buttons like ALT, Ctrl, and Shift do not work on their own in Scratch. The F-Numbers at the top also do not work.
Shift however will only work to give you capital letters, or the symbols above the numbers on your keyboard.
Shift however will only work to give you capital letters, or the symbols above the numbers on your keyboard.
ajlim0403
loading
Aw, that sucks. Thanks for the help
NMario84
loading
Yea it is a shame. A lot of wasted potential for such buttons. But as I understand it, Scratch was made to be a very simple programming language for all ages. Adding more keys would just add to the complexity.
planetguyman
loading
it doesn't work and it makes a dumb beep noise
--Irrelevant
loading
https://scratch.mit.edu/projects/838004515/I am making a keyboard project where if you click a key, it will light up on the project:
However, if you click buttons like A, it will also light up alt and shift. T does this with tab and shift. When I tried the following code:<key (join [alt] []) pressed?>where the alt is in a variable called “#”. If I click the A key, it will say true for the code above. Please help. All key detection is on the custom block:define Tick <keyPressed>
I thought alt doesn't work on Scratch.