Below is a version that should work the same on any PC, instead of counting the number of cycles the key has been pressed for it uses the system timer to wait an exact number of milliseconds before repeating.
It also occurred to me that you could use this to do a longer delay after the first character and then fast repeat (like normal) so I added that in to
Dim typing$(20)
set text size 16
` This is the first keypress delay time
rtntypespeed = 400
bktypespeed = 400
Repeat
a$=entry$()
clear entry buffer
If keystate(28)=1
a$=""
if Timer() > t#
rtn = 1
t# = timer() + rtntypespeed
y=y+16
lne=lne+1
If lne>19 then exit
` This is the held key delay time
rtntypespeed = 40
endif
else
` This is the first keypress delay time
rtntypespeed = 400
endif
If keystate(14)=1
a$=""
if Timer() > t#
ks = 1
t# = timer() + bktypespeed
bsck=len(typing$(lne))-1
If bsck<0
If lne<1
line=1
y=1
else
lne=lne-1
y=y-16
bsck=len(typing$(lne))-1
endif
endif
typing$(lne)=left$(typing$(lne),bsck)
ink 0,0
box 1,y,500,y+16
ink rgb(255,255,255),0
text 1,y,typing$(lne)
` This is the held key delay time
bktypespeed = 40
endif
else
` This is the first keypress delay time
bktypespeed = 400
endif
If len(typing$(lne))>30
y=y+16
lne=lne+1
If lne>19 then exit
endif
If a$<>""
typing$(lne)=typing$(lne)+a$
ink 0,0
box 1,y,500,y+16
ink rgb(255,255,255),0
text 1,y,typing$(lne)
endif
if keystate(28)=0 then retkey=0
if keystate(14)=0 then delkey=0
Until escapekey()
Cls
ink rgb(255,0,0),0
For t= 1 to 20
text 1,t*15,typing$(t)
next t
wait mouse