you can do that with the KEY ON and the ON KEY statement. With this piece of code your program will stop when the ESC key is hitted: (if after the stop label the end statement in typed)can somebody plz tell me how F1-12 , Ctrl , Alt and shift are identified by inkey$? (i won't be rude like that anymore)
KEY(27) ON
ON KEY(27) GOSUB STOP
and with this you can use te F-keys where num is the number between 1 and 10, for F11 and F12 you must use 31 and 32:
KEY(num%) ON
ON KEY(num%) GOSUB
I hope you will find something in my answer
greetz scorpion