09-16-2018, 12:54 AM
I'm thinking of re-doing my spectranet client but I need a good inkey$ input routine. the one I have ether misses keys presses or does multi letters.
I am using
#include <input.bas>
#include <keys.bas>
any hekp
I am using
#include <input.bas>
#include <keys.bas>
Code:
MAIN:
NETmainloop()
gosub NETinputloop
NETmainloop()
goto MAIN
NETinputloop:
for timeout=0 to 1500 : next timeout
if rowx=0 then printat64(22,0):print64(xx$+" "):goto NetJump1 : end if
FOR ii = 0 TO rowx : printat64(22,ii):print64(chr$(peek (@MyLabel + ii))) : NEXT ii : print64(xx$+" ")
NetJump1:
let k=code inkey$ : for timeout=0 to 1500 : next timeout
if k>31 and k<128 then goto NetKeyPress : end if
if k=13 then goto senddata : end if
if k=12 then goto NetDeleteKey : end if
return
NetDeleteKey:
if rowx=0 then goto NETinputloop : end if
POKE (@MyLabel + (rowx-1)), 0
let rowx = rowx - 1
return
NetKeyPress:
if rowx=length then goto NETinputloop : end if
POKE (@MyLabel + rowx), k
let rowx = rowx + 1
return
senddata:
printat64(22,0):print64(" ")
POKE (@MyLabel + rowx), 13
POKE (@MyLabel + rowx+1), 10
poke (@MyLabel2),(rowx+2)
poke (@MyLabel2+1),0
send2()
NETline()
for ii=0 to rowx+1 : POKE (@MyLabel + ii), 0 : next ii
let rowx=0
return
END
any hekp
I'm always on the chat or facebook.