_Title "One Key - Best so far Choice$" ' b+ 2021-10-09 ' Best in my opinion One Key Control as date above
'setup for Choice$ function
Dim Shared KeyTimer
, place
' preserve values between choice$ calls KeyTimer
= Timer ' <<<<<<<<< init outside main choice calling loop
'
' Here we can run all the backgound graphics we want with no pauses waiting for input
'
Print "Use this One Key tool to Input your name or something using only spacebar!" Print "Select by spacing until highlite is over your choice letter or menu #." Print "Use Menu #1 at end of letters to signal the end of you input, like enter." Print "Use Menu #2 to actually insert a space in the text!" Print "Use escape to quit" Print "Progress: "; text$
'''' KeyTimer = Timer ' <<<<<<<<<<<<<<<<<<<<<<<<<<<< no not just before calling choice, start outside loop
c$ = choice$(10, 5, " A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 ")
If c$
<> "" And c$
<> " " And c$
<> "1" And c$
<> "2" Then text$
= text$
+ c$
Print "User input "; text$;
", resetting for another go." KeyTimer
= Timer 'reset for another go round text$ = ""
If c$
= "2" Then text$
= text$
+ " "
Function choice$
(row
, col
, selection$
) ' One Key User Input System with tiny little setup ' setup for best results space out selections$ for one letter at a time choice
' dim shared KeyTimer in main, set KeyTimer like KeyTimer = timer outside main loop with Choice$
If Timer - KeyTimer
>= 4 Then choice$
= Mid$(selection$
, place
+ 1, 1): place
= 0
show:
'_Display now the main loop handles since this is no longer a loop