termemu.js: implement cursor hiding.
This commit is contained in:
parent
d5b4cb5de0
commit
de69f47fc1
1 changed files with 23 additions and 0 deletions
23
termemu.js
23
termemu.js
|
|
@ -37,6 +37,7 @@ function Cursor(src) {
|
|||
this.fg = src.fg;
|
||||
this.bg = src.bg;
|
||||
this.cset = src.cset;
|
||||
this.visible = src.visible;
|
||||
}
|
||||
else {
|
||||
this.x = 0;
|
||||
|
|
@ -47,6 +48,7 @@ function Cursor(src) {
|
|||
this.fg = null;
|
||||
this.bg = null;
|
||||
this.cset = "B";
|
||||
this.visible = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -268,6 +270,8 @@ var termemu = {
|
|||
/* Swaps the text and background colors of the active location. */
|
||||
/* This will change when other cursor styles are supported. */
|
||||
/* Check: the cursor might be offscreen if it was resized. */
|
||||
if (!this.c.visible)
|
||||
return;
|
||||
if (this.c.x != null && this.c.y != null && this.c.x >= 0 &&
|
||||
this.c.x < this.w && this.c.y >= 0 && this.c.y < this.h) {
|
||||
var oldcell = this.screen.childNodes[this.c.y].childNodes[this.c.x];
|
||||
|
|
@ -1015,6 +1019,14 @@ var termemu = {
|
|||
/* Wraparound ON is the only mode implemented. */
|
||||
debug(0, "Wraparound mode");
|
||||
}
|
||||
else if (params[i] == 25) {
|
||||
/* Show the cursor. */
|
||||
if (!this.c.visible) {
|
||||
this.c.visible = true;
|
||||
this.flipCursor();
|
||||
}
|
||||
debug(0, "Showing cursor");
|
||||
}
|
||||
else if (params[i] == 1048) {
|
||||
this.saveCursor();
|
||||
}
|
||||
|
|
@ -1042,6 +1054,17 @@ var termemu = {
|
|||
if (params[i] == 1) {
|
||||
keyHexCodes.appCursor(false);
|
||||
}
|
||||
else if (params[i] == 12) {
|
||||
debug(0, "Stopping blinking cursor");
|
||||
}
|
||||
else if (params[i] == 25) {
|
||||
/* Hide the cursor. */
|
||||
if (this.c.visible) {
|
||||
this.flipCursor();
|
||||
this.c.visible = false;
|
||||
}
|
||||
debug(0, "Hiding cursor");
|
||||
}
|
||||
else if (params[i] == 1048) {
|
||||
this.restoreCursor();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue