Listen for any key press

How can I listen for any key press, and be able to get the key that was pressed?
Maybe like this?
[scratchblocks]
add key press listener (say (key) inputs: (key) :: looks) :: grey
[/scratchblocks]

image
image

the wording for the (last key pressed) block is wrong; it should be "key pressed".

oh yeah right
im too lazy to fix the images so you can just change the block accordingly if you want

I made a DOM one a long time ago...
OH!Its the terminal project!https://snap.berkeley.edu/snap/snap.html#present:Username=18001767679&ProjectName=[Mini%20Comp]Text%20Editor(supporting%20shift%20and%20ctrl)

What have I done wrong?

ProjectName=getKeyPressed

The keysPressed is misspelled as keyspressed

Thank you :slight_smile:

Just use a million when _ key presseds

does that seem easier?

nope, but it does work pretty nicely

no, that would also be very laggy and take up a lot of cpu, besides it wouldn't be worth the trouble to set up, also you can just use find first item or javascript

it would also take up a lot of space in the project file.

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