Last key pressed without using JavaScript

The first thing to come into your mind when you want to get the last key pressed without JavaScript is to use a when key pressed event block for every key, and set the last key pressed variable to a constant string depending on which key is set in the event block. Obviously, for every key, this would take quite a while. Then maybe if you're not as clever and know JavaScript you decide to use JavaScript instead. But there is a way to get the last key pressed without taking forever to do, and without the use of user JavaScript code.

You can use a list find first item block with the key pressed sensing block and a list of all the keys that are able to be pressed. Constructing that list by hand will take a while, but fortunately you can use the unicode as letter block and the numbers from to block to programmatically create a list containing all the alphanumeric characters. The rest will be constructed by hand, but there are only 7 left so that will not take a long time.


(don't put an actual space character like i did, put the word "space")

This solution wasn't actually made by me by the way. Also, this code can also be modified a bit to get a list of all the keys that are pressed during a given time.