Look inside this project to see how to detect keys that are not normally detectable on scratch. It can even detect keys that can only be typed while holding shift, such as #. This is unable to detect the difference between a capital letter and a lower case letter. Feel free to use this and modify it as you need to. No need to give credit unless you want to.
This could use some improvement, since it is a little glitchy. I would recommend making adjustments to this if you are going to use it so that it works properly. I didn't really spend much time trying to remove the glitches.