Posted: 08:57pm 11 Sep 2013 |
Copy link to clipboard |
Print this post |
|
It probably should be something like this. In most of the cases you can get away with BackSpace support only, but if you need to be able to walk through the text, insert and delete, then it will be a bit more complex code.
(writing it at the moment so errors ARE possible):
s$="" ' this will be the output string
k0$="" ' this is to catch the moment of pressing the key only
Timer=0
do
k$=inkey$
if k0$="" and k$<>"" then
if asc(k$)>=32 then
s$=s$+k$
print k$;
endif
if asc(k$)=8 and s$<>"" then
s$=left$(s$,len(s$)-1)
print chr$(8);" ";chr$(8);
endif
Timer=0
endif
k0$=k$
loop until k$=chr$(13) or Timer>=1000
if (Timer>=1000) then s$="" ' timeout will return a null string
Edited by kiiid 2013-09-13 http://rittle.org
-------------- |