Skip to content

thirdcoder/tritmapped-terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tritmapped-terminal

Tricolor tritmapped 45x28 character 9x14 terminal display

npm version

Usage:

var Triterm = require('tritmapped-terminal');

var t = Triterm(opts);

t.writeUChar('H');
t.writeUChar('i');
t.refresh();

Emulates a terminal wrapping a tritmapped-canvas, with 9x14 character output and keyboard input from trit-text.

For an example, run npm start or try the live demo. Type characters to write to the tritmapped trit-text terminal.

Options:

  • handleInput: function to call with (tt, ev) trit-text character codepoint and HTML5 DOM event when user presses a key
  • cooked (true): if true, writing characters interprets control codes
  • all options are passed through to tritmapped-canvas

API:

t.writeUChar(u)

Write a Unicode character (must be supported by trit-text).

t.setTTChar(tt, x, y)

Set (x,y) coordinate to a trit-text character tt.

t.refresh()

Redraw the HTML5 canvas.

t.writeTTChar(tt)

Write a trit-text character and append the hardware cursor.

t.forward()

Move the cursor forward, incrementing the column, and if at the end, incrementing the row if necessary then resetting the column.

t.backspace()

Move the cursor backwards, decrementing the column, and if at the beginning, decrement the row if necessary then resetting the column.

About

tricolor tritmapped 45x28 character 9x14 terminal display

Resources

License

Stars

Watchers

Forks

Packages

No packages published