This a project that detects which keys are pressed and even detects {backspace}, and it does it in a way where you are not saying : if(a key pressed) add a if (b key pressed) add b etc. if you want to use this for a game feel free to (it would be nice if you gave me credit but you don't have to) but you will have to copy the lists (right click the list and then click export)
all by me