improve mouse enabling.

This commit is contained in:
Christopher Jeffrey 2013-07-14 07:16:33 -05:00
parent 155eac8677
commit 2105eb3d5b
1 changed files with 13 additions and 15 deletions

View File

@ -367,6 +367,12 @@ Program.prototype._bindMouse = function(s) {
// key.action = 'movement';
//}
// Probably a movement.
if (key.action === 'mousedown' && key.button === 'unknown') {
delete key.button;
key.action = 'mousemove';
}
self.emit('keypress', null, key);
self.emit('mouse', key);
@ -2238,14 +2244,18 @@ Program.prototype.normalBuffer = function() {
Program.prototype.enableMouse = function() {
if (this.term('rxvt-unicode')) {
return this.setMouse({ urxvtMouse: true }, true);
return this.setMouse({
allMotion: true,
urxvtMouse: true
}, true);
}
if (this.term('xterm') || this.term('screen')) {
if (this.term('xterm')
|| this.term('screen')
|| this.term('rxvt-unicode')) {
return this.setMouse({
allMotion: true,
utfMouse: true
// sendFocus: true
}, true);
}
@ -2255,18 +2265,6 @@ Program.prototype.enableMouse = function() {
};
Program.prototype.disableMouse = function() {
//return this.setMouse({
// x10Mouse: false,
// vt200Mouse: false,
// hiliteTracking: false,
// cellMotion: false,
// allMotion: false,
// sendFocus: false,
// utfMouse: false,
// sgrMouse: false,
// urxvtMouse: false
//}, false);
if (!this._currentMouse) return;
var obj = {};