Inputs to "When Key Pressed" Code Block?

In an art & music class, students participate in an activity in which they use the computer keyboard to enter notes to compose a song. Unfortunately the "When Key Pressed" block does not include the equal key "=" as an option on the dropdown menu. However, until the current version of Snap!, other keys could be entered using the "Key Pressed" block as a work around. In the current version, it is no longer possible to drag other code blocks into the "When Key Pressed" input slot; only options on the dropdown menu seem to be allowed.

Since the current version of Snap! is not backward compatible in this respect, unless someone can suggest a work-around, we'll have to re-write the student guide to this activity. Any thoughts or suggestions would be appreciated.

image

The [When [=] Pressed?] block (shown in the image below) seems to work. (The orange Identity block is from the Big Num library.)

image

The ability to drop an expression into WHEN KEY PRESSED was disabled in umm 6.0 I think, but was re-enabled by popular demand in 6.3 I think. You may need to clear your cache.

hm... it seems like it wasn't re-enabled it :snap: 6.3

Oh oops! I was thinking of the Sensing predicate. Sorry!

I just tried
image

and it seems to work for me

It was put back in here on 15Dec20

Yes, you can put anything in the generic WHEN hat block, including the KEY PRESSED? predicate, into which you can put a reporter. That has more or less the same effect as, although isn't the same as, the WHEN KEY PRESSED hat block.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.