Hi again...
I created this little piece of code to show how it "usually" done, using the example of Mizipzor's encryption program as the basis. So here goes;
rem the string array to hold the input/output...
dim a$(2)
rem the encryption string for this example
a$(1)="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
rem An empty string that will be the output.
a$(0)=""
rem a small routine to get 26 characters.
rem (even though Mizipzor uses 29)
for t = 1 to 26
set cursor 0, 0
print a$(1) : rem print display string.
print a$(0) : rem print collected string.
get_key : rem get a letter
a$(0) = a$(0) + a$(2) : rem add letter to output
next t
rem print all before saying bye-bye
set cursor 0, 0
print a$(1)
print a$(0)
end
rem this is the function that checks the keyboard
rem and returns the character pressed to the main
function get_key
rem wait for a keystroke....
loop1:
a$(2) = inkey$()
rem NOTE: put your mouse detect code here.
if a$(2) = "" then goto loop1
rem wait for the key to be released...
loop2:
b$ = inkey$()
if b$ = a$(2) then goto loop2
rem and leave it.
endfunction
That is pretty much "routine" for most Basic programs, a constant loop to switch between different devices. The encryption string is the same as an input prompt, and you have the option of echoing the keys back to the user, editing for backspace, and so on.
Good luck!
S.
[edit: oops! I forgot some REM commands... it's correct now.]
Any truly great code should be indisguishable from magic.