PRINT "Enter some information (CTRL-V works fine for insert): ";
ExtendedInput information$
PRINT "You entered: "; information$
CP = 0: OldCP = 0 'Cursor Position
SELECT CASE k
'ignore all keypresses except ALT-number presses CASE 48 TO 57: AltWasDown
= -1: alt$
= alt$
+ CHR$(k
) SELECT CASE k
'without alt, add any keypresses to our input oldin$ = in$
IF CP
> 0 THEN OldCP
= CP: CP
= CP
- 1 in$
= LEFT$(in$
, CP
) + MID$(in$
, CP
+ 2) 'backspace to erase input oldin$ = in$
in$
= LEFT$(in$
, CP
) + SPACE$(4) + MID$(in$
, CP
+ 1) 'four spaces for any TAB entered OldCP = CP
CP = CP + 4
oldin$ = in$
'CTRL-V leaves cursor in position before the paste, without moving it after.
'Feel free to modify that behavior here, if you want it to move to after the paste.
'CP = CP + LEN(_CLIPBOARD$)
oldin$ = in$
in$
= LEFT$(in$
, CP
) + CHR$(k
) + MID$(in$
, CP
+ 1) 'add input to our string OldCP = CP
CP = CP + 1
CP = 0
oldin$ = in$
CP = CP - 1
CP = CP + 1
alt$ = "": AltWasDown = 0
blink
= (blink
+ 1) MOD 30