This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-08-02 13:18:51

Seil
Scratcher
Registered: 2011-09-02
Posts: 100+

More key support!

To be honest, I'm very annoyed that Scratch limits key controls to only letters, numbers, and arrow keys. And you can only left-click.

There should be more key support in Scratch 2.0, allowing you to have more key controls, whether you're making a game, or an online experiment, or whatever. It should at least include "when Shift", "Alt", and "Ctrl pressed". And, if it's possible, it would be cool if there was even Left Shift, Right Shift, Left Alt, etc.

This way you could also have a script saying

if <(key [right shift v] pressed?) and (key [3 v] pressed?)>
add [#] to [list v]
end
This next thing is different, but it would work with more key controls. If you could copy/paste from clipboard:

if <(key [left ctrl v] pressed?) and (key [v v] pressed?)>
set [clipboard variable v] to (clipboard)
replace item (1 v) of [list v] with (clipboard variable)
end
if <(key [left ctrl v] pressed?) and (key [c v] pressed?)>
set [clipboard variable v] to (selected text variable)
copy (clipboard variable) to clipboard
end
The clipboard would actually be a sensing reporter.


There should also be other keys in When [ ] pressed blocks, including characters like -=\[];',./`, and the user can also use the (key [ ] pressed?) sensing block to detect the shifted keys of these.

Also, another suggestion would be, if there were to be a When Enter pressed block, the Enter key will only restart the project IF there's not a When Enter pressed, or a (key [Enter] pressed?) block present in the project. If there is, then the project will run that script instead. This could be useful if you wanted to, for example, pause a game.

Or maybe... there could be key support for the Esc key! This would be very useful.

And finally, there should be support for the right mouse button. This could be useful if you were, for example, making a first-person shooter game and you could use the right mouse button to aim. Yes, I know there's some way projects can detect this, but it would be a lot easier if Scratch had this.
Also, the middle mouse button would be good, too. Or at least the mouse wheel.


This was quite a long post--I didn't even know it would turn out to be this long.
Anyways, please leave feedback. Thanks.


http://legacy-cdn.smosh.com/smosh-pit/022011/spongebob-gif-lol.gif

Offline

 

#2 2012-08-02 14:46:52

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: More key support!

Lightnin says we could add more keys, but we would need to keep the list from growing too large, and also we'd need to keep in mind that some devices may not have those keys. (If scratch ever goes on Android, then the ctrl, alt functions will be useless since Android has neither).

I want the copy thing though.

I dont think the right-mouse button is possible since then there would be no way to adjust the flash player settings (just right click on any old project and you will see). And not all mice have middle buttons so that probably isnt a good idea.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#3 2012-08-02 14:53:58

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: More key support!

Most mice have the scrolling wheel...

Anyway, I'd like:

<key [any v] pressed?>


http://i47.tinypic.com/2iaa73k.png

Offline

 

#4 2012-08-02 14:57:27

Seil
Scratcher
Registered: 2011-09-02
Posts: 100+

Re: More key support!

Wes64 wrote:

... also we'd need to keep in mind that some devices may not have those keys. (If scratch ever goes on Android, then the ctrl, alt functions will be useless since Android has neither).

... I dont think the right-mouse button is possible since then there would be no way to adjust the flash player settings (just right click on any old project and you will see). And not all mice have middle buttons so that probably isnt a good idea.

I never thought about that, actually.

I don't have any kind of cell phone, but can Android support Flash?

About the right mouse button, I've seen quite a bit of projects with this kind of sensor, but you would need to download or else use the Java player.
Since Scratch is completely switching to Flash, the same thing would still happen, so you'd either have to download to get all the features of the project, or you could implement the Online/Offline sensor in your project.

And a lot of mice without middle mouse buttons are quite old, but I do see your point. As far as I know, a lot of modern laptops have middle mouse buttons, but no wheel. So I agree with you on that, it probably isn't a very good idea.


http://legacy-cdn.smosh.com/smosh-pit/022011/spongebob-gif-lol.gif

Offline

 

#5 2012-08-02 14:58:25

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: More key support!

berberberber wrote:

Most mice have the scrolling wheel...

Anyway, I'd like:

<key [any v] pressed?>

that would be quite useful, I mean the only alternative is a chain of 41 booleans in a bunch of ()or()'s.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#6 2012-08-02 15:04:03

Seil
Scratcher
Registered: 2011-09-02
Posts: 100+

Re: More key support!

berberberber wrote:

Most mice have the scrolling wheel...

Anyway, I'd like:

<key [any v] pressed?>

Support.

I think the only current way is to do

<<(key [up arrow] pressed?) or (key [down arrow] pressed?)> or (key [left arrow] pressed?)>
etc. then
<<(key [a] pressed?) or (key [b] pressed?)> or (key [c] pressed?)>
etc.

It's so time-consuming and very frustrating, so I completely agree with you.


http://legacy-cdn.smosh.com/smosh-pit/022011/spongebob-gif-lol.gif

Offline

 

Board footer