"Teletype" like emulator

I’m trying to create a custom class to be re-used in a variety of future project I have in mind.
This class will pretty much consist of a canvas (although I “might” use a TextView instead, but that is not important)

What this will do is emulate a “teletype” or more closely the edit screen in early PC/desktop computers. Text only, 80 char per line, fixed font (Menlo)
What I am trying to determine is what built in functions need to be available and exposed to the controlling app

  • CLEAR - this will clear the screen, and move the “cursor” the the top/left
  • PRINT(s) will append the text in “s” to the controls buffer and update the display
  • BACKSPACE - moves cursor back, but not before beginning of current line entry [NonDestructive]
  • DELETE - moves cursor back, but not before beginning of current line entry [Destructive]
  • TEXTCOLOR - set the color for any text from the PRINT command
  • BACKCOLOR - set the display background color (Default=BLACK) … I MAY get fancy and allow background changes same as TEXTCOLOR

This control will be somewhat “generic” in that it won’t be tied to WHAT the app needs… the app will accept entered text and decide what to “do” with it outside of the control. The control is soley for entering and display of the text data itself (think TRS-80 or IBM PC, QuickBasic etc)

No plans to add ability to set cursor position (other than bksp, and as char are appended

What features can anyone thing of the would be required for such a control… other that what I mentioned?

I have been thinking of buying an old Kaypro CP/M machine or TRS-80 as I am missing green or yellow phosphor in my life. Ideas for functions are hard without an idea what you intend to do with it… old text adventure games? (Taking to yourself is a sign of impending mental collapse.") Perhaps an ability to save screenshots; overlay a text dialog box; require 1 char text input (Y/N); wordstar commands :), lotus 1/2/3 menus based on the “/” key… my imagination goes wild! :slight_smile:

actually 3 ideas (mostly old ones).

  1. a Retro Startrek game… I already have one I wrote years ago in Swift, but the “console” is too fragmented. This would only require sending typed commands to a “processor” and the “processor” sending data back
  2. a Retro Basic … this too I have already done, and again not a consistent console manager… this would require a bit more as in lines could be edited etc… but still that would be handled “outside” and updated communicated to the “console”
  3. yeah, a Text Adventure

So it really would be scrolling text, with the input always on the last visible line. The cursor would always be constrained to the current “edit buffer” with the exception of the CLEAR command which would move it to 0,0

So the function set just needs to be those things the the “console” control needs to allow the actual app to exercise the right control over the display