To navigate through my menu you use the up and down arrow keys and use the enter key to select an option. Anyway, when you select Start from my menu I have a section where you input your initials and you have to press enter again to accept the input - My only problem is that it loads the bit where you input your initials but it instantly goes off and straight onto my game. It's a problem with the key press. When you select start and press enter from the menu, it also takes that enter button as the next section - where you input your name. Can anyone help me. Is there a way of delaying the key presses?
if position = 1
ink rgb(255,255,255),0
box 220,140,420,180
ink 0,0
box 221,141,419,179
if returnkey() = 1
if canpress = 1
goto start
canpress = 0
endif
start:
`This is where the user enters their initials
hide mouse
sync on
sync rate 0
`The input string
InpStr$ = ""
` Set the max number of characters in the string
MaxLength=3
repeat
`Handle input
char$ = entry$()
select asc(char$)
case 8 : `Backspace
InpStr$ = left$(InpStr$, len(InpStr$) - 1)
endcase
case 14 : `Carriage return
`In this case, we do nothing. It's just to prevent that a carriage return
`is added to InpStr$
endcase
case default
` Check if the length of InpStr$ is less than the max length
if len(InpStr$)<MaxLength
InpStr$ = InpStr$ + char$
endif
endcase
endselect
clear entry buffer
`Display the text
cls
set text size 16
center text 320,200, "Enter you initals below then press enter:"
set text size 14
center text 320,250, InpStr$
sync
until returnkey()=1
cls
center text 320, 200, "Get Ready"
wait 5
Thanks in advance, Bankzy10!