You just have to add mouse detection around those areas while your entering text. It can't be done with the "input" command because "input" stops all action till the user hits enter.
It can however be done with the "entry$()" command.
This works in both Classic and Pro. This goes forever switching with the enter key and mouseclick around the boxes till the user clicks on the "Ok" box.
` Make an "Ok" box
box 0,0,50,25
ink rgb(192,192,192),0
box 1,1,49,24
ink rgb(10,10,10),0
center text 25,5,"Ok"
` Grab the image
get image 1,0,0,51,26,1
` Clear the screen and paste the ok box
cls
paste image 1,50,100
` Always clear the entry buffer before detecting keys with "entry$()"
` Otherwise you may start this with characters already in "entry$()"
clear entry buffer
` Overwrite previous text
set text opaque
` Create a switch ( 0 = Working on Name 1 = Working on Password )
CWork=0
do
` Check if Name is being worked on
if CWork=0
` If yes change color to white
ink rgb(255,255,255),0
` Change cursor to show
Cur$="|"
else
` If not change color to grey
ink rgb(100,100,100),0
` Change cursor to not show
Cur$=" "
endif
` Print name
text 0,0,"Name: "+Name$+Cur$+" "
` Check if Password is being worked on
if CWork=1
` If yes change color to white
ink rgb(255,255,255),0
` Change cursor to show
Cur$="|"
else
` If not change color to grey
ink rgb(100,100,100),0
` Change cursor to not show
Cur$=" "
endif
` Make a star version of the password
PassStar$=""
for t=1 to len(Pass$)
PassStar$=PassStar$+"*"
next t
` Print Password stars
text 0,20,"Password: "+PassStar$+Cur$+" "
` Get a key and clear the buffer
a$=entry$():clear entry buffer
` Look for backspace
if left$(a$,1)=chr$(8)
` Check if the name is currently being worked on
if CWork=0
` If yes delete one character from the name
Name$=left$(Name$,len(Name$)-1)
else
` If no delete one character from the password
Pass$=left$(Pass$,len(Pass$)-1)
endif
` Clear a$
a$=""
endif
` Check for enter key
if left$(a$,1)=chr$(13)
` Check if currently working on Name
if CWork=0
` If yes change to Password
CWork=1
else
` If no change to Name
CWork=0
endif
` Clear a$
a$=""
endif
` If a$ still has a character add it to the string
if a$<>""
` Check if working on name
if CWork=0
` If yes add letter to name$
Name$=Name$+a$
else
` If no add letter to pass$
Pass$=Pass$+a$
endif
endif
` Check for mouseclick
if mouseclick()
` Check if the mouse coordinates are within the name box
if mousex()>=0 and mousey()>=0 and mousex()<=640 and mousey()<=17
` Change switch to name
CWork=0
endif
` Check if the mouse coordinates are within the password box
if mousex()>=0 and mousey()>=23 and mousex()<=640 and mousey()<=37
` Change switch to password
CWork=1
endif
` Check if the mouse coordinate are within the "Ok" box
if mousex()>=50 and mousey()>=100 and mousex()<=100 and mousey()<=125
` Leave the do/loop
exit
endif
endif
` Show the mouse coordinates (for debugging)
`text 0,150,str$(mousex())+" "
`text 0,170,str$(mousey())+" "
loop
text 0,150,"Name$ = "+Name$
text 0,170,"Pass$ = "+Pass$
wait key