I saw that turbowarp.org has a reporter block called "last key pressed". I don't know if that reporter block can be used in scratch so I made my own, that has all of the keys that work on my computer. This does not support uppercase letters yet, it does support characters like > or < that are uppercases of other characters on the keyboard. It can not run while the project is not running yet.
turbowarp, which is made by @garbomuffin Feel free to use (just backpack the sprite). I will update eventually. 97 blocks two variables 1 list 1 sprite (or you can also use the backdrop as this sprite)