Discuss Scratch

wizzwizz4
Scratcher
92 posts

Enable unnecessarily locked out features on <key [... v] pressed?>

I've recently discovered that there are things possible with this block that are unnecessarily locked out in the editor.
<key [... v] pressed?>
If you were to try to place a variable inside it, it wouldn't work. It wouldn't fit in. But if you modify the Scratch Project JSON so the variable IS in it:
<key (Why is there no other way?) pressed?>
It works as normal, with the value of the variable being the list item. And you can have a list with all the possible keys, then use something like this:
delete (all v) of [keysPressed v]
set [variable v] to [1]
repeat (length of [keysList v])
if <key (item (variable) of [keysList v]) pressed?> then
add (variable) to [keysPressed v]
end
change [variable v] by (1)
end
to check which keys are down. There could even be a list in sensing for it, but that is not my current suggestion.
There is another thing:
If the variable's value is blank, it detects OTHER KEYS, including Ctrl, Cmd, Meta and Shift, most importantly Shift. There is no reason for these not to be implemented (apart from that the Scratch Team might have better things to do like fixing bugs that delete people's projects) and Shift would really help for projects that you type text for.
So my suggestions are:
<<<key (variable) pressed?> and <key [Shift v] pressed?>> and <<key [Ctrl/Cmd v] pressed?> and <key [Meta v] pressed?>>>
These are all possible with the current code and would not require much work to implement, but many people's projects would benefit from it.

If anyone's interested, I've been working on ScratchEdit! If you want to help, click here for things to help with.

A long time ago, wizzwizz4 wrote:

Generation 2: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment

Look at A quest (at best). Follow wizzwizz2 and wizzwizz4. Also, check out the Scratch Team! Or, you could create a magic custom block! Accurate sums without rounding from Scratch, three-dimensional rendering and Wave Mechanics. Dodge flying shapes
Image in Progress
            .,-:;//;:=,
. :H@@@MM@M#H/.,+%;,
,/X+ +M@@M@MM%=,-%HMMM@X/,
-+@MM; $M@@MH+-,;XMMMM@MMMM@+-
;@M@@M- XM@X;. -+XXXXXHHH@M@M#@/.
,%MM@@MH ,@%= .---=-=:=,.
=@#@@@MX ., -%HX$$%%%+;
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
TheHockeyist
Scratcher
1000+ posts

Enable unnecessarily locked out features on <key [... v] pressed?>

Support!

Why not add
<key [, v] pressed?>
<key [\ v] pressed?>
<key [[ v] pressed?>
etc.
while you're at it?

Last edited by TheHockeyist (Aug. 7, 2014 12:54:31)



Greatguy123
Scratcher
500+ posts

Enable unnecessarily locked out features on <key [... v] pressed?>

Support!

The evil if block is hungry! >:-D
savaka
Scratcher
1000+ posts

Enable unnecessarily locked out features on <key [... v] pressed?>

What's the meta key? Is that the OS logo key? And I think there should be no dropdown at all. I think it should work like game control setup screens work.
WARNING: THE TOPIC I LINKED TO GOT MERGED SO THE REPLIES ARE KIND OF INACCURATE
wizzwizz4
Scratcher
92 posts

Enable unnecessarily locked out features on <key [... v] pressed?>

savaka wrote:

What's the meta key? Is that the OS logo key?
Bang on. When I used a Windows-based keyboard with my Raspberry Pi, the Windows Key came up as Meta Key on every single application: DOS-Box, Nano and even Xinit! So yeah.

If anyone's interested, I've been working on ScratchEdit! If you want to help, click here for things to help with.

A long time ago, wizzwizz4 wrote:

Generation 2: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment

Look at A quest (at best). Follow wizzwizz2 and wizzwizz4. Also, check out the Scratch Team! Or, you could create a magic custom block! Accurate sums without rounding from Scratch, three-dimensional rendering and Wave Mechanics. Dodge flying shapes
Image in Progress
            .,-:;//;:=,
. :H@@@MM@M#H/.,+%;,
,/X+ +M@@M@MM%=,-%HMMM@X/,
-+@MM; $M@@MH+-,;XMMMM@MMMM@+-
;@M@@M- XM@X;. -+XXXXXHHH@M@M#@/.
,%MM@@MH ,@%= .---=-=:=,.
=@#@@@MX ., -%HX$$%%%+;
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
robosnakejr
Scratcher
1000+ posts

Enable unnecessarily locked out features on <key [... v] pressed?>

Support







;
VoltageGames
Scratcher
1000+ posts

Enable unnecessarily locked out features on <key [... v] pressed?>

This idea always gets turned down because it will clutter the drop down.
It would be easier if instead of a dropdown, there was a string.
<key [ ] pressed?>
(so you can input the key you want)

i3-6100 / r9 380 / 8 gigs ram / 1 tb hdd

Click here to inflate my ego and thank me for my posts.


lalala3
Scratcher
100+ posts

Enable unnecessarily locked out features on <key [... v] pressed?>

VoltageGames wrote:

This idea always gets turned down because it will clutter the drop down.
It would be easier if instead of a dropdown, there was a string.
<key [ ] pressed?>
(so you can input the key you want)
Or there could be an option on the last page of the key drop-down that pulls up the picture of a keyboard, or simply reads the next key press, the way it works in video games where you can change the keybinds.

jTron
Scratcher
100+ posts

Enable unnecessarily locked out features on <key [... v] pressed?>

I'd support this - my suggestion would be a dropdown like
key( v) pressed? :: sensing
where you can type a letter or symbol but also select options like tab, delete, meta, etc.

Scratch actually can detect a lot more keys than you'd think. Check out my project, Keydown Detection+, which detects the most different keys of any keypress detection project that I'm yet aware of.

Here's a question - how should scratch handle action keys? For example, if we used:
= control | alt/option | meta (winkey/command)
as options, projects made for windows users (control being main action key) would be uncomfortable for mac users and projects made on for macs would be completely impossible as winkey would simply bring up the start menu (or the metro … thing.) But if we used:
= control/command | alt/option | control/winkey
it seems confusing as control is there twice. In addition, if the player is grabbing keyboard commands, it can be hard to, for example, quit using Cmd+Q, etc. Maybe the best thing would be to have just
= action
which equals control on mac and alt on a pc - so it doesn't take away important commands (?) and is usable on any machine.

This also brings up the idea of the
when action & [q v] pressed :: events hat
hat - could be useful? Then Scratch would know which commands to snatch at the beginning and the browser could have the rest.

clipd • osx clipboard manager and history

;
MushroomMan99
Scratcher
100+ posts

Enable unnecessarily locked out features on <key [... v] pressed?>

Support. This would make text editors easier.

when green flag clicked
if <(language) = [English ]> then

say [Everything is Awesome!] for (2) secs
end
if <(language) = [French ]> then

say [Tout est super-genial!] for (2) secs
end
if <(language) = [Italian ]> then

say [E meraviglioso!] for (2) secs
end
if <(language) = [Spanish ]> then

say [Todo es fabuloso!] for (2) secs
end

Powered by DjangoBB