Ah well in that case I'd use entry$(). I thought he was trying to use it for controls such as WASD. Here's my get_entry() function ripped from my standard text input source file:
rem ---------------------------------------------------------
rem Text input function - by TheComet
rem ---------------------------------------------------------
rem setup screen
sync on
sync rate 60
backdrop on
color backdrop 0
rem get entry from user
a$ = get_entry("Did you eat all of the cupcakes?!")
rem print message to screen
do
text 0,0,"Your input was " + chr$(34) + a$ + chr$(34)
sync
loop
rem end
end
rem functions -------------------------------------------------------
function get_entry(ME_Message$)
rem locals
local r as byte
local g as byte
local b as byte
rem clear entry buffer
ME_ThisEntry$=""
clear entry buffer
rem loop for input
MC_CC = timer()
repeat
rem control cursor
if timer() - ME_CC > 400
ME_CC$="¦"
if timer() - ME_CC > 800 then ME_CC = timer()
else
ME_CC$ = " "
endif
rem this will get what's in the entry buffer and store it
ME_K$ = entry$()
clear entry buffer
rem here we process the entry
for r = 1 to len( ME_K$ )
rem extract current character
ME_Y$ = mid$( ME_K$ , r )
rem backspace
if asc( ME_Y$ ) = 8
ME_ThisEntry$ = left$( ME_ThisEntry$ , len( ME_ThisEntry$ ) - 1 )
else
rem you can change the length limit of the input message by changing the number 29
if asc( ME_Y$ ) >= 32 and len( ME_ThisEntry$ ) < 29
ME_ThisEntry$ = ME_ThisEntry$ + ME_Y$
endif
endif
next r
rem print message to screen
center text 512 , 320 , ME_Message$
center text 512 , 350 , ME_ThisEntry$ + ME_CC$
rem control copying and pasting
if controlkey()=1 and keystate(46)=1 then write to clipboard ME_ThisEntry$
if controlkey()=1 and keystate(47)=1 then ME_ThisEntry$ = get clipboard$()
rem refresh screen
sync
rem exit with returnkey if input message isn't empty
until returnkey() = 1 and ME_ThisEntry$ > ""
endfunction ME_ThisEntry$
What's also interesting with the code above is when you set the sync rate to something really low, say 5. It is still able to capture everything.
TheComet