screen.screenshot

This commit is contained in:
Christopher Jeffrey 2015-04-26 02:34:17 -07:00
parent 963cfbb9f8
commit 3d8dfd0db4
2 changed files with 8 additions and 2 deletions

View File

@ -2017,9 +2017,9 @@ Screen.prototype._cursorAttr = function(cursor, dattr) {
Screen.prototype.screenshot = function(xi, xl, yi, yl, term) {
if (xi == null) xi = 0;
if (xl == null) xl = this.lpos.xl;
if (xl == null) xl = this.cols;
if (yi == null) yi = 0;
if (yl == null) yl = this.lpos.yl;
if (yl == null) yl = this.rows;
var x
, y

View File

@ -252,6 +252,12 @@ button.on('press', function() {
screen.append(button);
screen.key('S-s', function() {
stext.wrap = false;
stext.setContent(screen.screenshot());
screen.render();
});
screen.on('keypress', function(ch, key) {
if (key.name === 'tab') {
return key.shift