Hi, I'm new to Scratch. I've got a great idea but I'm already struggling.
How can I make it possible to press two keys at once and get an action out of it.
Till now I only could find the possibility of press one key and get an action.
e.g. when 'f' key is pressed
[block]<when[ ]key pressed> [/block]
But I want ; e.g. When 'shift' and 'f' are pressed
Is this possible and how?
I want to make it accessible for key users with short keys (mostly a combination of keys.
Thanks!!!
Offline
raining wrote:
Hi, I'm new to Scratch. I've got a great idea but I'm already struggling.
How can I make it possible to press two keys at once and get an action out of it.
Till now I only could find the possibility of press one key and get an action.
e.g. when 'f' key is pressed
[block]<when[ ]key pressed> [/block]
But I want ; e.g. When 'shift' and 'f' are pressed
Is this possible and how?
I want to make it accessible for key users with short keys (mostly a combination of keys.
Thanks!!!
The "shift" key isn't supported in Scratch, but it is very possible to create an action with two keys. Instead of using a script like this:
<when[ ]key pressed> . . .
Use a script like this:
<when green flag clicked>
<forever>
<if><< <key[ ]pressed?> <and> <key[ ]pressed?> >>
so and so . . .
I hope I could help!
Offline
Figured it out already.
[block]<when[ ]key pressed>[/block][block]<forever>[/block]
[block]<( <<<key[ ]pressed?>> )><<<key[ ]pressed?> <and> <key[ ]pressed?> >>[/block]
Just place another
[block]<< <and> >>[/block]
over the first upon the second field.
Last edited by raining (2009-06-05 12:15:28)
Offline
Great!
Another question. So I made a combination 1 (sprite) of 'press F and J key ' and another combination 2 (sprite) 'press F, J and k key ' . They've got different actions.
If I give it a try they interfere with each other, if a press F, J, and K, both actions start.
I only want to start the action of combination 2, how can I solve this?
Offline
if j pressed and f pressed and not k pressed
Offline
I'm glad you've been making progress!
Offline