Okay, I think I get your situation. I can't look at your capx now but will try to tomorrow if you are still having problems.
So I assume from this they are typing in the letters on the keyboard?
One idea off the top of my head is instead of using a textbox to detect keyboard input and only do anything if it matches.
Either way, I would probably start by loading the letters into an array.
Create a variable that starts as false (boolean or 0)
Loop for array.width
-if [letter to check] = array(loopindex) set variable to true/1
If variable = true/1 then update text/allow the letter to be added.
If you let them type anything in the textbox then you would have to check it after and remove as opposed to allow. But you can do the same in a nested loop
Loop for textboxt.length
-Loop for array.width
--if [letter to check] = array(loopindex) set variable to false and end loop
Can't look at the capx right now so not sure what you have already and if this helps or not...