class BBS::Field

A one-line input field at the cursor, for a modern terminal and a Commodore 64 alike: it starts from a text that can be edited rather than typed again, the cursor keys move in it, typing inserts at the cursor and DEL (backspace) deletes before it. A text longer than the field scrolls sideways. The text and the cursor live in a BBS::TextBuffer, so the editing keys do what they do in a BBS::Editor.

The field takes width columns from where the cursor is; on a C64 keep it out of the last column. It moves the cursor with a BBS::Cursor, only sideways.

Keys:

cursor left, right

move

HOME, END

the start and the end of the text

DEL, backspace

deletes the character before the cursor

Delete

deletes the character under the cursor

RETURN

ends the input

RUN/STOP, โ†, Esc

cancels it

session.write ' title> '
title = BBS::Field.new(session, text: post.title, width: 31, max: 80).run