I have just made a input from the user limited to 8 characters. If the player try to input more than 8 it wil be ignored. It's have the option to use backspace. So if the player type somthing wrong he or she can correct it. I use a bitmap font to put the input on the screen. But if you want to use just text you can. Replace The call to smalFont in Text x,y,Text$. Its check the valid input of characters. And the line "If Len(Name$) < 8" You can change the 8 in a 3 if you like. As you can see its a function. Its return the name op the player.
I have also made a input field where the player only can klick on the letters on the screen. ( The letters is ordered in a matrix) And even there the player can only input as mutch as you want to have.
I hope you can extract that what you want to have.
Function GetName()
`Get the name of the player
If name$=""
`In previous turn name is rememberd
Name$ = "NOBODY"
endif
max=10
While scancode()<>28
Smal_Font(Name$,150,230)
If Timer() > delay
Leter$ = Inkey$()
`If leter$<>""
` print Asc(leter$)
`Endif
IF Leter$ = CHR$(8)
` Backspace in pressed.
If Len(Name$) >0
` So remove the last input
Name$=Left$(Name$,Len(Name$)-1)
Smal_Font(" ",150,230)
Smal_Font(Name$,150,230)
Delay = Timer() + 150
Endif
Endif
If leter$ > Chr$(31) and Leter$ < Chr$(123)
If Len(Name$) < 8
` add letter in text
Name$ = Name$ + Leter$
Smal_Font(" ",150,230)
` make all upper case
Name$ = Upper$(Name$)
Smal_Font(Name$,150,230)
Delay = Timer() + 150
endif
endif
endif
sync
Endwhile
Endfunction Name$
Never say a question is stupid. Questions not ask are stupid.